I am using "tinyMCE.triggerSave(true, true);" before the form submit.
And
I am using
jQuery validation plugin for the form validation ( in
http://jqueryvalidation.org/). And the my code is as follows (This works perfect in IE8+ and Google Chrome):
//form submit function and the form validationjQuery('#frm').submit(function() {
// update underlying textarea before submit validation
tinyMCE.triggerSave(true,true);
}).validate({
errorClass: 'error',
rules: {
//validation rules
'users':'required'
},
submitHandler: function(form) {
//submit confirmatiom
if (confirm('Are you sure you want to submit the form?' ){
$('#frm').ajaxSubmit({
beforeSubmit: beforeFormSubmit, // pre-submit callback
success: afterSubmit // post submit callback
});
return false;
}
}
});
//pre-submit callbackfunction beforeFormSubmit(){
$('#btn_submit').val("Saving...");
$.blockUI(); //block ui plugin
}
//post submit callbackfunction afterSubmit(response, status) {
if(status == 'success') {
$('#message_box').html("Success.")
}else{
$('#message_box').html("Error : "+response)
}
$.unblockUI();
}