Hello everyone,
Get this message when a user has successfully filled in all fields, which doesnt appear in Firefox. Code in function is something like this.. (form is only one on page, so used [0] rather than the id, but it doesnt make any difference - still get the same error message.

Anyone know why?

Many thanks,



function init()
document.forms[0].onsubmit = validateFields;

return true;

function validateFields()
var firstname = document.forms[0].elements["firstname"];
var lastname = document.forms[0].elements["lastname"];
var email = document.forms[0].elements["email"];
var telephone = document.forms[0].elements["telephone"];
var emailPattern = /^[\w\.\-]+@([\w\-]+\.)+[a-zA-Z]+$/;

if (firstname.value == "")
alert("Please fill in your first name");

return false;

etc etc