Tag: tinymce

去掉TinyMCE自动加上段落标记p

没有评论

2011年04月28日 at 2:23 上午分类:前端技术

为了防止出现最初的P标签,您需要添加下面一行到你的初始化语句:
tinyMCE.init({
… force_p_newlines : false //当返回或进入 Mozilla/Firefox 时,这个选项可以打开/关闭段落的建立。选项默认值为:true。
});

Popularity: 3% [?]

jquery validation和tinymce非空验证问题

没有评论

2010年07月6日 at 2:53 下午分类:前端技术

jquery validation对tinymce的内容都要点击两次才能提交,第一次点击即使用内容还是提示为空。于是用firebug看了下,是因为textaera里的内容是点击以后才付值进去,网上找了下解决办法如下:

tinyMCE.init({
        mode : "textareas",
        theme : "advanced",
        plugins : "fullscreen",
        theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,code,|,fullscreen",
        theme_advanced_buttons2 : "",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : true,
        elements : "content",
        init_instance_callback : "initialiseInstance"
    });
    function initialiseInstance(editor)
    {
        //Get the textarea
        var container = $('#' + editor.editorId);
 
        //Get the form submit buttons for the textarea
        $(editor.formElement).find("input[type=submit]").click(
        function(event)
        {
            container.val(editor.getContent());
        });
    }

Popularity: 8% [?]