2010-08-11 73 views
7

我已經嘗試了所有的以下內容:如何禁用TinyMCE的的textarea的

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

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

這是我如何加載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.'); 
     }); 
    } 
}); 
+0

你只需要它是隻讀的,還是你想要「禁用」風格? – 2010-08-11 05:51:30

+0

只讀是好的,但我需要啓用它使用jQuery。 我得到的tinyMCE在大多數情況下沒有定義。 – fuzz 2010-08-11 06:02:04

回答

10

添加readonly : true到您的PARAMS。

+0

好的,那有效。但是,我將如何重新啓用textarea? – fuzz 2010-08-11 05:54:14

+3

嘗試類似這樣:'Readonly' – 2010-08-11 05:58:54