[thelist] Form validation error

thelist at cjmarsh.com thelist at cjmarsh.com
Wed Mar 9 18:45:00 CST 2005


> A friend of mine got an email from a client pointing out that their 
> ordering form was not working properly.
> The form has a validation script to validade all fields and 
> somehow the 
> fields are not being validated properly. The alerts do come up but 
> instead of going back to the unfilled field the form is sending it 
> through even though you get a server error when you try to 
> send it. To get an idea of what she is talking about you can 
> go to: http://www.williamthomas.ca/order.shtml
> and try filling the form (use HI LORRAINE) in the name field so she 
> knows it's bogus and try sending the form without the address or the 
> phone number, etc...
> I checked the name of the form and the form fields against the 
> validation and it doesn't seem to be that but I am probably missing 
> something small.
> Any help is very appreciated,

You are firing the validation check using the onclick event handler for
the submit button. Try removing "document.userform.submit();" from the
end of thankyou(), and removing the onclick event handler from the
submit button. Then place the following in the form tag:

onsubmit=''return thankyou()"



Chris Marsh

No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.7.1 - Release Date: 09/03/2005

More information about the thelist mailing list