I created a signup form using Bootstrap’s signin form example code, and I’m trying to perform a crude verification on the form before the form action takes place. However, I’m noticing that even though I return false the form action still get’s submitted and I get loaded to the form action page. How can I stop this from happening when the values of the form are invalid (ie: email is something like abcdef).
Here’s a fiddle: http://jsfiddle.net/CCsJn/1/
Notice that even though the code returns false, the form submits.
Searching brought me to this question, but that code did not work for me
Silly me! It was a typo!
elem.focus()should beemail.focus()