diff --git a/lib/editor/tinymce/module.js b/lib/editor/tinymce/module.js index 4b227d132bb..d3118ef0f33 100644 --- a/lib/editor/tinymce/module.js +++ b/lib/editor/tinymce/module.js @@ -45,7 +45,6 @@ M.editor_tinymce.init_editor = function(Y, editorid, options) { M.editor_tinymce.initialised = true; M.util.js_pending('editors'); options.oninit = "M.editor_tinymce.init_callback"; - options.onchange_callback = "M.editor_tinymce.onchange_callback"; } M.editor_tinymce.editor_options[editorid] = options; @@ -93,12 +92,6 @@ M.editor_tinymce.init_callback = function() { M.util.js_complete('editors'); } -M.editor_tinymce.onchange_callback = function(editorinstance) { - // We need to keep the underlying textarea in sync so that when the form - // validator is triggered, it has the value property up-to-date. - editorinstance.save(); -}; - M.editor_tinymce.init_filepicker = function(Y, editorid, options) { M.editor_tinymce.filepicker_options[editorid] = options; }; diff --git a/lib/formslib.php b/lib/formslib.php index fe7c5c28835..19b15bb8958 100644 --- a/lib/formslib.php +++ b/lib/formslib.php @@ -2316,6 +2316,9 @@ var skipClientValidation = false; } catch(e) { return true; } + if (typeof window.tinyMCE !== \'undefined\') { + window.tinyMCE.triggerSave(); + } if (!myValidator()) { ev.preventDefault(); }