How to disable writing into an integrated text editor ?


I was taking reference from this two links below to make text editor using code mirror. The links are as follows:

However, due to some reasons, I need to disable (make readonly) writing to this editor. I tried below two options but they are not working:

readOnly: true

How can I make the editor readOnly (i.e disable typing) with only some fixed and template text.




  • try this

      editor.options.readOnly = true;
  • edited August 6

    Hi intrgal

    This is working here

    In my application, all the code is inside webix.ready block. The code that you pasted is not working if I write inside webix.ready block.
    Not sure what wrong is going on.



    This seems to work. The getEditor function should also be inside ready function as it will return a undefined for the mirror_notepad object if defined elsewhere. I think that is why it is not working for you right now.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!