If returned bSubmitp value is other than false, then the form will be submitted.
With a return true you are saying that the button must work add is intended... and
-the submit button is for sending the form-
If you want to disable at all cost, I suggest a predefined return false.
Could be:
on the form tag in onsubmit like:
<form onsubmit="return false">
in your javascript function like you have now but creating a conditional return value, like:
<form onsubmit="return yourFunction()">
with jquery like:
$('form').submit(function() { // do stuff return false; });
others..
Edit
Additionally.. you could change the input type:submit to just a button
Then send the form with jQuery (after validation).
And to prevent form submit when enter key is pressed as @Daniel Lisik point it out...
need to acomplish two condition (without javascript)
- No
input type:submit buttons present in the form - More than one input field.
$("#your_form_id").submit(function(e)since the user also can submit form with enter.