【问题标题】:How to disable TinyMCE's textarea如何禁用 TinyMCE 的 textarea
【发布时间】:2011-03-28 04:46:25
【问题描述】:

我已经尝试了以下所有方法:

$(#"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.');
        });
    }
});

【问题讨论】:

  • 您只需要它是只读的还是想要“禁用”样式?
  • Readonly 很好,但我需要使用 jQuery 启用它。我得到 tinyMCE 在大多数情况下没有定义。

标签: jquery tinymce textarea


【解决方案1】:

readonly : true 添加到您的参数中。

【讨论】:

  • 好的,成功了。但是我将如何重新启用 textarea?
  • 试试这样的:<a href="#" onclick="tinyMCE.execCommand('contentReadOnly');return false;">Readonly</a>
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2013-03-08
  • 1970-01-01
  • 2020-07-05
  • 2012-10-14
  • 1970-01-01
  • 1970-01-01
  • 2011-01-13
相关资源
最近更新 更多