TinyMCE textarea and post form using ajax

后端 未结 5 1380
抹茶落季
抹茶落季 2020-12-05 19:36

I m using tinyMCE for textareas and POSTing form through AJAX.

But when I m trying to save textarea value, it is taking old values on first click, but it takes updat

5条回答
  •  渐次进展
    2020-12-05 20:20

    You can configure TinyMCE as follows to keep the values of hidden textareas in sync as changes are made via TinyMCE editors:

    tinymce.init({
        selector: "textarea",
        setup: function (editor) {
            editor.on('change', function () {
                tinymce.triggerSave();
            });
        }
    });
    

    With this in place, you can access up-to-date values directly from the textarea elements at any time.

    This has been tested on TinyMCE 4.0

    Demo running at: http://jsfiddle.net/9euk9/

提交回复
热议问题