Edit a text in cuteeditor

Last post 06-25-2012, 8:14 AM by Kenneth. 3 replies.
Sort Posts: Previous Next
  •  06-25-2012, 4:03 AM 73991

    Edit a text in cuteeditor

    Hi Guys,
     
    I have this situation that I have a customize button to add a text with a marquee
     
    on my c# code I use Editor.text += strmrq;
     
    But I have this problem everytime I want to edit the text, but the new text with the change will insert on the editor but not update the old text.
    How will I update the text?
     
    Please help.
     
    Thanks
    pilots
     
  •  06-25-2012, 5:59 AM 73995 in reply to 73991

    Re: Edit a text in cuteeditor

    Hi pilotsredlix,
     
    Update what text? the text of the <marquee> target? or?
     
    If you mean the  <marquee> target , you should can click on it to edit it directly.
     
    Regards,
     
    Ken 
  •  06-25-2012, 7:15 AM 73999 in reply to 73995

    Re: Edit a text in cuteeditor

    Hi Ken,
     
    here's my sample code
    StringBuilder marq = new StringBuilder();
     
    marq.Append("<marquee direction=\\" + this.drpdirection.SelectedValue + "\" behavior=\\" + this.drpbehavior.SelectedValue + "\" >sample</marquee> ");
     
    Editor1.Text+=marq.ToString();
     
    my problem is I have a dialog where I can select the direction and behavior
    if I want to modify the behavior or direction it will create a new marquee with the changes.
    It won't overwrite the old properties of the text sample.
    even if I select the text sample and click the button to show the dialog.
     
    Thanks,
    pilotsredlix
     
  •  06-25-2012, 8:14 AM 74001 in reply to 73999

    Re: Edit a text in cuteeditor

    hi pilotsredlix,
     
    CuteEditor has not provide the way to set the  marquee target properties directly. So I think you need to remove the old target and replace it with the a new one.
     
    How to get the selected html http://www.cutesoft.net/developer+guide/scr/Get-HTML-from-Selection.htm 
     
    And use API "PasteHTML()" to replace the selected html http://www.cutesoft.net/developer+guide/scr/JavaScript-API.htm 
     
    Also, you can get the editor document object and find the <marquee> target by the document object. Then you can change its properties by javascript code. The editor document object has the same functions as the normal html document object. 
     
    Regards,
     
    Ken 
View as RSS news feed in XML