[thelist] JS Form Validation

Joshua Hmielowski jhmielowski at comcast.net
Thu Jul 1 12:14:49 CDT 2004


> I have been trying to get the most simple validate form to work and 
> have had no luck.
> I have tried MANY different ways of calling this JS function and to no 
> avail. For some reason
> the function is not getting called. I have tried:
>
>  onSubmit="javascript: return ValidateForm(this);"
>  onSubmit=" return ValidateForm(myForm);"
>  onSubmit=" ValidateForm(myForm);"
>
> and pretty much every combination of those 3.
>
> Can anyone see anything that I am missing or misspelling here?
> I have tested the alert() box to see if JS was even turned on and that 
> worked..but no function luck.
>
>
> <script language="javascript" type="text/javascript">
> <!--
>
> function ValidateForm(form)
> {
>    if(IsEmpty(form.realname))
>    {
>       alert('You have not entered a first name')
>       form.realname.focus();
>       return false;
>    }
>
> return false;
>
> }
> //-->
> </script>
>
>
> <form  method="POST" action="mailto.php" name="myForm" 
> onSubmit="return ValidateForm(this);">
>
> 		<input type="hidden" name="recipient" value="blahblah at blah.com">
>
> 		<input type="hidden" name="subject" value="TEST">
>
> 		<input type="hidden" name="redirect" 
> value="http://www.roaringforkvehicles.com/thankyou.html">
> 								
> 		<input type="text" name="realname" size="5">
> 								
> 		<input type="submit" name="submit" value="submit">
> </form>
>


Joshua Hmielowski
Independent Studio
Tel: 970-429-7469
Cell: 970-274-0870


More information about the thelist mailing list