View Single Post
Old 02-18-2013, 09:23 PM   PM User | #6
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,248
Thanks: 59
Thanked 3,999 Times in 3,968 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Another way to do it:

Don't use onsubmit= in the </form>.

And don't use a submit button.

Instead, just use
Code:
<input type="button" value="Submit" onclick="validateForm()" />
Then it doesn't matter what you return from validateForm, the form won't get submitted.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote