Custom Button

Last post 03-09-2005, 2:57 PM by Adam. 1 replies.
Sort Posts: Previous Next
  •  02-23-2005, 2:37 PM 4246

    Custom Button

    I have created a custom button, that when clicked will:
    1) If text is higlighted, delete the selected text and replace with "Test Text"
    2) If NO text is highlighted it will just insert "Test Text" where the cursor is located
     
    The problem I am having is when text is selected, the selected text is not being deleted.
    I am using the _Format(editor,'Cut'); to cut out the selected text, but it is not working.
     
    We are using CuteEditor v3.0.
    Here is the sample page I put together:
  •  03-09-2005, 2:57 PM 4501 in reply to 4246

    Re: Custom Button


    Your code is here:
     
     
     
    Solution:

    Change the following code from:
     
    editor2.CustomAddons = "<span...>Insert Html</span>"
     
    to:
     
    editor2.CustomAddons = "<button...>Insert Html</button>"
      
    Your code will work.
     
    Suggestions:

    You don't need to create your paste HTMl JavaScript code.

    You can use the built-in funtion like: 

    onclick=""_Format(Editor2,'insertHTML','html code');""

    onclick=""Paste_Html1('Editor2','Test Text');""

    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

View as RSS news feed in XML