?
Solved

jQuery Validate: Event if all valid and form submitted

Posted on 2011-03-02
7
Medium Priority
?
877 Views
Last Modified: 2012-05-11
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

0
Comment
Question by:Aidam-Unlimited
  • 3
  • 2
6 Comments
 
LVL 83

Expert Comment

by:leakim971
ID: 35021583
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

0
 
LVL 83

Expert Comment

by:leakim971
ID: 35325755
How did you resolve it?
0
 

Accepted Solution

by:
Aidam-Unlimited earned 0 total points
ID: 35325848
Solution is here.

If somebody found this useful, please let me know (post a comment).
$(document).ready(function() {

	$("form").validate({
	 submitHandler: function(form) {
		$("input[type='submit']").attr("disabled", true).val("Please wait...");
	   form.submit();
	 },
	 errorPlacement: function(error, element) { } //Removed error labels, I've got input {border: red;} only
	});
	
});

Open in new window

0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:Aidam-Unlimited
ID: 35325860
//Objecting
0
 
LVL 83

Expert Comment

by:leakim971
ID: 35326183
Thanks
0
 

Expert Comment

by:ModCorlEEone
ID: 35364775
Restarting auto-close process on Aidam-Unlimited's behalf after posting own solution.
 
ModCorlEEone
Community Support Moderator
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question