briancf
02-10-2003, 10:10 PM
I found a javascript function for validating user entered email addresses that seems to work by enforcing a single "@" and a single "." etc. I'm not comfortable using it until I can explain how it works. Confusing part is the IF statement coded as follows. Any hints or references to explain what is happening to the left side of the ".test" would be appreciated. Help Please!
Here's the function
function checkEmail(myForm) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.emailAddr.value)){
return (true)
}
alert("Invalid E-mail Address! Please re-enter.")
return (false)
}
Thanx in advance for any help.
Here's the function
function checkEmail(myForm) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.emailAddr.value)){
return (true)
}
alert("Invalid E-mail Address! Please re-enter.")
return (false)
}
Thanx in advance for any help.