TinyMCE not sending value

前端 未结 3 2172
清酒与你
清酒与你 2020-12-06 17:44

Hi All
It\'s the first time I\'ve used Tiny Mce and I have a problem. Please Help

The editor works fine in editing but when I click submit nothing is sent from t

3条回答
  •  清歌不尽
    2020-12-06 18:27

    Why TinyMCE is not sending updated value?
    Tinymce will not update the html/content of hidden textarea input field when you are using ajax to submit a form. You need to update the content/html of textarea input field manually before submit a form using tinyMCE.triggerSave(). Note: textarea will be hidden when you will use it as Tinymce.

    How TinyMCE will send updated value?
    Now we will push the content/html of TinyMCE to textarea.

    $("form").submit(function (event) {
            event.preventDefault();
            tinyMCE.triggerSave(); //this line of code will use to update textarea content
            
            //your ajax function/code
    });
    

提交回复
热议问题