How to disable CKeditor with jQuery

Viewed 46055

I am using CKEditor in my web application and need to disable/enable the editor from javascript. I know that there is an option called readOnly but I don't know how to set it from jQuery.

Does anybody know how to disable and enable back the CKEditor using jQuery please?

10 Answers

If you have multiple ckeditors on a page. Below solution worked for me.

   CKEDITOR.instances.instance_name.on('instanceReady', function(ev) {
      var editor = CKEDITOR.instances.instance_name;

      //for disable
      editor.setReadOnly();

      //for enable
      editor.setReadOnly(false);    
                                                
    });
Related