Only submit after validation
So I have some stuff I want to do when a form is submitted. It looks like this:
- $('#scan').submit(function(event) {
$('#log').fadeOut(1000, function() {
$( "#log" )
.load( "../log.html")
.fadeIn("slow", function() {
$( "#log p:first" ).effect("pulsate", { times:3 }, 500);
});
});
event.preventDefault();
});
But I am using the validation plugin:
http://docs.jquery.com/Plugins/Validation/Methods
and I don't want that stuff to happen unless it passes all the validation. For example, if a field is required, all of that stuff gets executed regardless if there is anything in the required field. How do I stop that from happening?