views:

198

answers:

1

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.');
                });
            }
        });
+1  A: 

Add readonly : true to your params.

Soufiane Hassou
Okay, that worked. But how would I then re-enable the textarea?
Fulvio
Try something like this: `<a href="#" onclick="tinyMCE.execCommand('contentReadOnly');return false;">Readonly</a>`
Soufiane Hassou
What about in jQuery? In certain areas of my application I disable/enable this textarea and usually call these within an existing method.
Fulvio
Okay in order to get tinyMCE working, I had to include the "tiny_mce_src.js" file as well.
Fulvio