|
Your code isn't preventing the submission of the form, because it isn't capable of doing that.
Nothing on that page instructs the form to submit.
You need <input type="submit">
You need to attach your function to the onsubmit event, and on error it must return false.
|