Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable TinyMCE's textarea

I've tried all of the following:

$(#"tbxNote").attr("disabled", "disabled"); ////doesn't work
$(#"tbxNote").attr("disabled", "true"); //doesn't work either :)

tinyMCE.init( mode: "none" ); //throws an error

This is how I'm loading TinyMCE:

//load tinymce plugin
$('#tbxNote').tinymce({
    // Location of TinyMCE script
    script_url: '/common/scripts/tiny_mce/tiny_mce.js',

    // General options
    theme: "advanced",

    // Theme options
    theme_advanced_buttons1: "link,unlink",
    theme_advanced_buttons2: "", //important
    theme_advanced_buttons3: "", //important
    theme_advanced_toolbar_location: "top",
    theme_advanced_toolbar_align: "left",
    theme_advanced_statusbar_location: "bottom",
    theme_advanced_resizing: false,

    setup: function (ed) {
        ed.onClick.add(function (ed) {
            //ed.windowManager.alert('User clicked the editor.');
        });
    }
});
like image 817
fulvio Avatar asked Aug 11 '10 05:08

fulvio


People also ask

How do I disable TinyMCE editor toolbar?

To disable the toolbar, the toolbar option should be provided a boolean value of false .

How do you make TinyMCE readonly?

Use the checkbox to toggle between the "design" and "readonly" modes.

How do you destroy TinyMCE?

Use tinymce. remove() method to remove TinyMCE editor from the HTML element and again call tinymce. init() on the selector to reinitialize.

How do I display TinyMCE content in HTML?

The TinyMCE getContent and setContent methods You can do this using the getContent() API method. Let's say you have initialized the editor on a textarea with id=”myTextarea”. This will return the content in the editor marked up as HTML.


1 Answers

Add readonly : true to your params.

like image 176
Soufiane Hassou Avatar answered Sep 17 '22 22:09

Soufiane Hassou