re-map the save button function?

Last post 10-09-2009, 9:42 AM by ethanmcdonald. 3 replies.
Sort Posts: Previous Next
  •  10-07-2009, 11:40 AM 56182

    re-map the save button function?

    How can I map the save button to use my own javascript function?
  •  10-07-2009, 12:23 PM 56183 in reply to 56182

    Re: re-map the save button function?

    Please check this example:
     
    http://cutesoft.net/asp/JavaScript-API.asp
     
    CuteEditor_OnCommand This event is invoked when the command button is clicked.

    Example:

    function CuteEditor_OnCommand(editor,command,ui,value)
     {
        //handle the command by yourself
       if(command=="InsertEmotion")
       {
          var answer = confirm("Click OK to stop this command.")
          if (answer){
             return true;
          }
          else{
             return false;
          }
       }
    }

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  10-08-2009, 12:38 PM 56232 in reply to 56183

    Re: re-map the save button function?

    That worked great for the most part except I cannot get the "Save" button to respond
    Currently I have my command mapped to the "Bold" button.
    Any thoughts?
     
     
    Code:

       Set editor = New CuteEditor
         
       editor.ID = "Editor1"
       editor.Text = content
       editor.FilesPath = "CuteEditor_Files"
       //editor.AutoConfigure = "Full_noform"
       editor.TemplateItemList = "Save,Separator,Bold,Italic,Underline,Separator,JustifyLeft,JustifyCenter,JustifyRight,Separator,InsertOrderedList,InsertUnorderedList,Separator,Indent,Outdent,Separator,Cut,Copy,Paste,Separator,netspell,Separator,Undo,Redo"
       editor.EditorBodyStyle = "font:normal 12px arial;"
       editor.EditorWysiwygModeCss = "asp.css"
       editor.ThemeType="officexp"
       editor.ShowHtmlMode = false
       editor.EditorOnPaste = "PasteWord"
       editor.Width = "100%"
       editor.Height = "500px"
       editor.MaxTextLength = "3000"
       
       editor.Draw()

    var editor1 = document.getElementById("<%=editor.ClientID%>");

    function CuteEditor_OnCommand(editor,command,ui,value) {
     //handle the command by yourself
     if(command=="Bold") {
      drafted = 0;
      autoDraft();
     }
     //alert(command);
    }

     
  •  10-09-2009, 9:42 AM 56266 in reply to 56232

    Re: re-map the save button function?

    I ended up making my own config and used a custom button.
    Thanks for the info.
View as RSS news feed in XML