Hi, I have this Javascript, but to be honest, I'm exactly sure what it means. I know that it's an email validator function, but what is the "elements" part? What does "(!(emailPattern.test(email)))" mean?
Thanks again for all the brains out there!!!
function emailTest(emailText)
{
var email = emailText.value;
var emailPattern = /^.+@.+\..{2,}$/;
if (!(emailPattern.test(email)))
{
alert("Please enter a valid email address.");
document.myForm.elements[1].focus();
}
}
2007-11-15
06:12:03
·
2 answers
·
asked by
J L
1
in
Computers & Internet
➔ Programming & Design