Client-side script to disable the Editor?

Last post 04-18-2010, 10:30 PM by Kenneth. 3 replies.
Sort Posts: Previous Next
  •  04-15-2010, 1:38 PM 60155

    Client-side script to disable the Editor?

    We have an aspx form with a textbox and and Editor control. We need to be able to disable the Editor control (and preferably remove the toolbars) in Javascript as a response to text being entered in the textbox. There's no enable/disable in the JS API.
     
    Can this be done?
  •  04-15-2010, 2:56 PM 60159 in reply to 60155

    Re: Client-side script to disable the Editor?

  •  04-16-2010, 6:34 AM 60172 in reply to 60159

    Re: Client-side script to disable the Editor?

    Adam,
     
    I don't see how that example applies. We've already got the Editor on the page and configured the toolbars with our own buttons, etc. I need to know if there is a way to disable the Editor control in Javascript on the client side. Removing the toolbars or not is a secondary requirement. 
     
    There is a textbox on the page that, if used, we would want to disable the Editor. It's an either/or and we need to disable the Editor in real-time, not on a postback.
     
    Thanks.
  •  04-18-2010, 10:30 PM 60204 in reply to 60172

    Re: Client-side script to disable the Editor?

    rschaeferhig:
    Adam,
     
    I don't see how that example applies. We've already got the Editor on the page and configured the toolbars with our own buttons, etc. I need to know if there is a way to disable the Editor control in Javascript on the client side. Removing the toolbars or not is a secondary requirement. 
     
    There is a textbox on the page that, if used, we would want to disable the Editor. It's an either/or and we need to disable the Editor in real-time, not on a postback.
     
    Thanks.
     
    Hi rschaeferhig,
     
    For now, editor does not support this function.
     
    Maybe you can try hide editor. example
     
    1. <%@ Page Language="C#" %>   
    2.   
    3. <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>   
    4. <html>   
    5. <head>   
    6. </head>   
    7. <body>   
    8.     <form id="Form1" runat="server">   
    9.         <CE:Editor ID="editor1" runat="server">   
    10.         </CE:Editor>   
    11.         <input type="button" value="Hide" onclick="hide()" />   
    12.     </form>   
    13. </body>   
    14. </html>   
    15.   
    16. <script>   
    17. var editor1 = document.getElementById('<%= editor1.ClientID%>');   
    18. function hide()   
    19. {   
    20. editor1.style.visibility="hidden";   
    21.   
    22. }   
    23. </script>  
    Regards,
     
    Ken
View as RSS news feed in XML