[thelist] JavaScript Form Validation

Karl Bunyan freelance at core10.co.uk
Wed Jul 16 11:19:16 CDT 2003


> response.write " <form name='form' action='fubar.asp' 
> method='post' onSubmit='simpleCheck(this); return false;'>"
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> <script language="javascript"><!--
> 
> function simpleCheck(form) {
> 
> if (form.first_name.value == "") {
> alert("Please include a first name");
> form.first_name.select();
> return false;}
> 
> else {
> form.submit();
> }
> 
> }
> //--></script>

Try changing the form tag to onSubmit='return simpleCheck(this);' and
putting putting

else{
	return true;
}

In the script. Should work...

Karl



More information about the thelist mailing list