TinyMCE textarea and post form using ajax

后端 未结 5 1375
抹茶落季
抹茶落季 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:00

    An alternative implementation to the one posted by Dan Malcolm, for TinyMCE 3.x, would be as follows:

    tinymce.init({
        selector: "textarea",
        setup: function (editor) {
            editor.onChange.add(function() {
                editor.save();
            });
        }
    });
    

    As well as working on 3.x, this version uses editor.save instead of tinymce.triggerSave, which means it only updates the current editor rather than all editors in the page.

提交回复
热议问题