jquery before form submit

72

jquery before form submit -

$('#myform').submit(function(event) {
 	event.preventDefault(); 			// Prevents the default submit
  	// your code here (not asynchronous)
	$(this).unbind('submit').submit(); 	// continue the submit unbind preventDefault
})

jquery before submit -

$('#myform').submit(function() {
  // your code here
});

Comments

Submit
0 Comments