Clearing text in CuteEditor using javascript

Last post 09-02-2010, 5:05 AM by vijayan59. 2 replies.
Sort Posts: Previous Next
  •  09-02-2010, 3:36 AM 63805

    Clearing text in CuteEditor using javascript

    Hi Experts,
     
    i want to clear the text field in CuteEditor when clear button is clicked.
    so can u pls help me to solve this issue.
     
    thanks in Advance
     
    regards,
    vijayan
  •  09-02-2010, 4:05 AM 63806 in reply to 63805

    Re: Clearing text in CuteEditor using javascript

    Hi vijayan59,
     
    Please try the example below
     
    1. <%@ Page Language="C#" %>   
    2.   
    3. <%@ Register Assembly="CuteEditor" Namespace="CuteEditor" TagPrefix="CE" %>   
    4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   
    5. <html xmlns="http://www.w3.org/1999/xhtml">   
    6. <head id="Head1" runat="server">   
    7.     <title>GetPlainText</title>   
    8. </head>   
    9. <body>   
    10.     <form id="form1" runat="server">   
    11.         <CE:Editor ID="editor1" runat="server">   
    12.         </CE:Editor>   
    13.         <div id="plainText" style="visibility: hidden">   
    14.         </div>   
    15.     </form>   
    16. </body>   
    17. </html>   
    18.   
    19. <script>      
    20. function CuteEditor_OnCommand(editor,command,ui,value)   
    21. {   
    22.     if(command=="CleanCode")   
    23.     {   
    24.         cleanTHML();   
    25.         return true;   
    26.     }   
    27. }   
    28. function cleanTHML()      
    29. {      
    30.     var editor1=document.getElementById('<%= editor1.ClientID %>');      
    31.     var plainText=document.getElementById("plainText");      
    32.     plainText.innerHTML=editor1.GetHTML();      
    33.     editor1.SetHTML(plainText.innerText)      
    34.     plainText.innerHTML="";      
    35. }      
    36.      
    37. </script>  
    Regards,
     
    ken
  •  09-02-2010, 5:05 AM 63808 in reply to 63806

    Re: Clearing text in CuteEditor using javascript

    Hi Mr.Ken.. its working , thank you very much for ur help..
     
    hope to continue this in future :-)
     
    thank you
     
    regards,
    vijayan
View as RSS news feed in XML