简体   繁体   English

TinyMCE-在Firefox中,不提交值

[英]TinyMCE - In Firefox, value doesn't submit

I am using TinyMCE for all my textareas, so that user can enter any formatted text. 我将TinyMCE用于我的所有文本区域,以便用户可以输入任何格式的文本。 Everything works fine in Google Chrome, but in Mozilla Firefox, the fields behave unexpectedly. 在Google Chrome浏览器中一切正常,但是在Mozilla Firefox中,这些字段的行为异常。 The values from the textareas doesn't get submitted unless I focus-out and focus-in again into the fields and then submit. 除非我将焦点移出并再次集中到字段中然后提交,否则不会提交textareas中的值。

I couldn't create a jsfiddle for my code, as I am using some old version of TinyMCE, so I couldn't replicate it. 我无法为我的代码创建jsfiddle,因为我使用的是TinyMCE的某些旧版本,因此无法复制它。 Here is my code: 这是我的代码:

tinyMCE.init({
    mode: "exact",
    elements: "description",
    theme: "simple",
    height: '100px',
    width: '100%',
    onchange_callback: function(editor) {
        tinyMCE.triggerSave();
        $("#" + editor.id).valid();
    }
});

Here is a similar jsfiddle for something I created with the new version and it has the same problem in both Chrome and Mozilla. 这是我用新版本创建的东西的类似jsfiddle ,它在Chrome和Mozilla中都存在相同的问题。 If I type something in the textarea and click submit, it is not shown unless I focus-out and submit again. 如果我在文本区域中键入内容并单击提交,则除非我将焦点移开并再次提交,否则不会显示该内容。

I added tinyMCE.triggerSave(); 我添加了tinyMCE.triggerSave(); in submit handler before submitting the form and it solved the problem. 在提交表单之前提交处理程序,它解决了问题。 Here is the jsfiddle . 这是jsfiddle

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM