Hi, i have a simple contact form (name, email, message) that has JS validation on it. However, it does not seem to work in FF but it works perfect in IE. In FF, it only picks up if the name field is blank, and not the validation on the email or message field, however in IE it works perfect for all fields. Can someone please take a look as i have spent ages trying to figure it out and i am getting no where, thanks site url: http://simoncasey.ie/joc/contact.html
my guess is that when the validate_name function returns true the form gets submitted.. comment out the validate_name function and see if the e-mail field becomes the only one to be validated..
Firefox has a built-in JavaScript console that shows any script errors on the page you open (go to Tools => Error Console). This is the error message I got: "contact is not defined" on this line: if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(contact.email.value)) Code (markup):
I think in FireFox you need to qualify the form name - try if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test([COLOR="Red"]document.[/COLOR]contact.email.value)) Code (markup):