Disabled

This example shows how to start an editor with the disabled attribute and how to manage enable/disable using the API.

API Commands

Code

<!-- buttons -->
<button onclick="enableEditor(event)">enable</button>
<button onclick="disableEditor(event)">disable</button>

<!-- element -->
<textarea id="entry" disabled>...</textarea>

<!-- call -->
<script>
let app = Redactor('#entry');

function enableEditor(e) {
    e.preventDefault();
    e.stopPropagation();

    app.enable();
}

function disableEditor(e) {
    e.preventDefault();
    e.stopPropagation();

    app.disable();
}
</script>