this is jQuery submit form code. what i like to know is how can i submit the form on using submitHandler. thanks in advance.
submitHandler: function(form) {
// do other stuff for a valid form
$.post('thankyou.php', $("#confrom").serialize(), function(data) {
$("#confrom").fadeOut('fast', function(){
$('#results').html(data);
});
});
}
There is a
submitHandler
built into the plugin that contains something likeform.submit()
. Since you're over-riding that with your own customsubmitHandler
, you still need to use thesubmit
. Otherwise, in your case, simply do some kind of Ajax instead of.submit()
.The
submitHandler
goes inside of the.validate()
method. In order to use the.validate()
method, you must first include the jQuery Validate plugin after you include jQuery.