TinyMCE not sending value

前端 未结 3 2149
清酒与你
清酒与你 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:26

    It is necessary to update the textareas content with the content of the editors iframe (tinymce uses an editable iframe like most rtes). In order to achieve this you need to call tinymce.get('elm1').save(); before you submit.

    You can also grab the editors content using tinymce.get('elm1').getContent(); and sent this.t

    0 讨论(0)
  • 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
    });
    
    0 讨论(0)
  • 2020-12-06 18:31
    function SubmitForm() {
        tinyMCE.triggerSave();
        $('#submit-form-training-materials').submit();
    }
    
    0 讨论(0)
提交回复
热议问题