Dynamically Disable CuteEditor or Set to Readonly via Javascript?

Last post 03-29-2010, 12:47 PM by Adam. 1 replies.
Sort Posts: Previous Next
  •  03-29-2010, 11:38 AM 59715

    Dynamically Disable CuteEditor or Set to Readonly via Javascript?

    Is there a good way or a workaround for setting the CuteEditor to disabled dynamically via Javascript?
     
    The application has a CuteEditor textbox and a checkbox that says 'Not Applicable'.
     
    If the user clicks the checkbox they want the editor to be disabled.
     
    The client does not want us to do it server side via an AutoPostback of the checkbox.
     
    The version of CuteEditor we are using for this app is 6.3.0.0
     
    I have seen one or two threads that say it can't be done but the last post was a few years back and I'm wondering if that was an older version of the control, or if people have come up with other reasonable workarounds, e.g. wrapping the control in a div or table and somehow disabling the wrapper control, or hiding it and showing a readonly version of text.
     
    Below is the starting point for my javascript function.  It gets a handle to the cuteEditor but setting the disabled property does not disable the control.
     
    function NotApplicableChanged(checkboxId, rootId) {
      var checkbox = document.getElementById(checkboxId);
      var cuteEditor = document.getElementById('CE_ce' + rootId + '_ID');
      if (cuteEditor != undefined) { cuteEditor.disabled = checkbox.checked; }
    }
     
    Thanks,
     
    Scott
     
  •  03-29-2010, 12:47 PM 59717 in reply to 59715

    Re: Dynamically Disable CuteEditor or Set to Readonly via Javascript?

    Scott,
     
     The ReadOnly property can not be set in the client side.  This is by design. If you do need  dynamically disable CuteEditor, I suggest you use Ajax and set ReadOnly in the server side.

    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