[thelist] JavaScript Form Validation

Jeff Howden jeff at jeffhowden.com
Wed Jul 16 11:24:56 CDT 2003


casey,

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: Casey Crookston
>
> This little script works great, except when it hits the
> form.submit(); line, and then it returns an error:
> "Object doesn't support this property or method."  And
> if I replace
>
> else {
> form.submit();
> }
>
> with a simple "return true;" then the form never submits.
> I should also add, here's the form tag:
>
> response.write " <form name='form'
> action='fubar.asp' method='post'
> onSubmit='simpleCheck(this); return false;'>"
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

replace "form.submit()" with "return true".

then, remove the "return false" from your onsubmit event handler and preface
the simpleCheck() function call with the return statement, like this:

onsubmit="return simpleCheck(this)"

finally, give this a read:

JavaScript: The Point of No Return?!
http://evolt.org/article/thelist/17/8869/

good luck,

.jeff

——————————————————————————————————————————————————————
Jeff Howden - Web Application Specialist
Résumé - http://jeffhowden.com/about/resume/
Code Library - http://evolt.jeffhowden.com/jeff/code/




More information about the thelist mailing list