Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

There are two ways to make the TinyMCE textarea read-only/disabled:

  1. Using the TinyMCE API:
// Get the editor instance
var editor = tinymce.get('mytextarea');

// Disable the editor
editor.setMode('readonly');

// Enable the editor
editor.setMode('design');
  1. Using HTML attributes:
<textarea id="mytextarea" readonly></textarea>

or

<textarea id="mytextarea" disabled></textarea>

Note: the readonly attribute allows the user to view the content, but not edit it. The disabled attribute prevents the user from interacting with the textarea at all.