【问题标题】:ajax Post data missing with tinyMCE on FirefoxFirefox 上的 tinyMCE 缺少 ajax Post 数据
【发布时间】:2010-06-14 19:38:42
【问题描述】:

当我尝试使用 ajax 提交时,我的表单出现问题。我正在为 Jquery 使用 Malsup Form 插件,但也使用 tinyMCE 编辑器。当我提交表单并检查 $_POST 数组时,textarea 中没有数据。我曾尝试使用 triggerSave() 函数,但无济于事。在 IE 中一切正常。

// These options are common and will be used for many form submissions

    var options = {
        target: '#notice',   // target element(s) to be updated with server response
        dataType:'html',
        resetForm:true,
        beforeSubmit: function(){tinyMCE.triggerSave(false,true);
        },

        success:function(msg){
            $('#notice').html( msg)
            refresh(3)
        }
    };
   //prepare form
    $('#savetext').ajaxForm(options);

【问题讨论】:

  • 你能得到不是textareas的其他元素的值吗?
  • 我可以得到它们并且可以用 alert(tinyMCE.activeEditor.getContent()) 来提醒文本区域的内容

标签: jquery ajax tinymce


【解决方案1】:

刚刚意识到使用 beforeSerialise: 而不是 beforeSubmit: 可以解决问题!

【讨论】:

  • 谢谢!我只花了至少一个小时试图完成这项工作最终做到了:var form_options = { target: '#result', beforeSerialize: showformSerialize, beforeSubmit: showformRequest, success: showformResponse, type: 'post' }; function showformSerialize(){ tinyMCE.triggerSave(false,true); }
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-09-21
  • 1970-01-01
  • 2018-08-05
  • 2019-04-04
  • 2018-02-05
  • 2015-07-02
  • 2011-12-08
相关资源
最近更新 更多