Catching Form submit before submitting it JQuery

By: Ryan Wong at

If you want to do some validation logic before the form is submitted, you can do the following:

1
2
3
4
$("#testform").submit(function(){
//do something
return true;
});

If you say return true, it will submit form. If false, stop form submission.

Hope it helps