I have Validation working across a form (I fire it several times before Submit to check sections of the form), and a tinyMCE editor working in 1 textarea. I want to move the contents of the tinyMCE iframe into the textarea before (that's the key here - before) the Submit button is pressed so that the contents can be validated in the section before Submit. I've used tinyMCE.triggerSave(); in several ways to move contents and then fire Validation before Submit. None work. I am beginning to believe that tinyMCE contents cannot be moved by any Javascript other than Submit, but I don't see that stated anywhere. In tinyMCE, I've tried onchange_callback: and handle_node_change_callback: to fire functions with triggerSave and other saving commands. I can get the contents of tinyMCE to validate when I press Submit twice (others have noted this peculiarity), but not in any other way. Also, when errors are corrected in tinyMCE, Validation does not revalidate until Submit is pressed.
2 questions -
Anyone know how to move tinyMCE contents into the textarea without hitting Submit?
Does CKEditor allow updates other than via Submit, and if so, where's a tutorial or example?
Here's an example of code that is supposed to be triggered by tinyMCE's onchange_callback, but only triggers upon the second click on Submit.
function tinyMCESetValue(inst)
{
var content = tinyMCE.activeEditor.getContent();
if (tinyMCE.activeEditor.isDirty()) {tinyMCE.triggerSave(true, true);}
// other save expressions that have been tried
//$("#selector").val(content);
//$("textarea.tinymce").val(content);
//tinyMCE.triggerSave();
//ed.save();
alert("some change"); //does not fire
}