TinyMCE textarea and post form using ajax

Use this instead of tinymce.triggerSave();

$('#' + 'your_editor_id').html( tinymce.get('your_editor_id').getContent() );

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/

Tags:

Ajax

Save

Tinymce