Link to home
Start Free TrialLog in
Avatar of Aidam-Unlimited
Aidam-UnlimitedFlag for United Kingdom of Great Britain and Northern Ireland

asked on

jQuery Validate: Event if all valid and form submitted

Hi,

I'm using jQuery Validate plugin from here - http://bassistance.de/jquery-plugins/jquery-plugin-validation/

The goal is to fire those two events only after jQuery validates all required fields and form has been submitted.

My code below does not work properly.

Any idea how to make it properly?

Thanks in advance
$("form").validate({
			    
success: function(html) { 
	$("form").submit(function(){
		$("input[type='submit']").attr("disabled", true).val("Please wait...");
		$(".stillloading").delay(4000).fadeIn(200);
	});
	}

});

Open in new window

Avatar of leakim971
leakim971
Flag of Guadeloupe image

When you submit your form, you stay away from the page and so, from your code.
You're on another page, perhaps with the same url but an other new page

You may use ajax to submit your form silently and after the submission, display a message and go away

Check this plugin : http://jquery.malsup.com/form/#ajaxSubmit

How did you resolve it?
ASKER CERTIFIED SOLUTION
Avatar of Aidam-Unlimited
Aidam-Unlimited
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Aidam-Unlimited

ASKER

//Objecting
Thanks
Restarting auto-close process on Aidam-Unlimited's behalf after posting own solution.
 
ModCorlEEone
Community Support Moderator