I have jQuery UI Dialog form, which has a TinyMCE editor. It is working well with Google Chrome and Internet Explorer8+.
But in Firefox, when I edit/change the content in the TinyMCE editor and while clicking the submit button, the page gets focussed on the TinyMCE editor for the first time. And in the second time it gets submitted.
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 validation jQuery('#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 callback function beforeFormSubmit(){ $('#btn_submit').val("Saving..."); $.blockUI(); //block ui plugin }