$('form').submit(function() {
alert($(this).serialize());
return false; // return true;
});
what's the difference for this form submission function between return false and true?
If you return false from the submit event, the normal page form POST will not occur.
return false, don't do the form's default action. return true, do the form's default action.
It's also better to do
$('form').submit(function(e) {
alert($(this).serialize());
e.preventDefault();
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With