Menu
I’m currently using a bit of JavaScript to validate a email entry in a form.
The spec has changed slightly and I now need to allow zero length strings or if they enter an address to run the check on it.
[CODE]
<SCRIPT LANGUAGE=”JavaScript”>
function checkEmail(myForm) {
if (/^w+([.-]?w+)*@w+([.-]?w+)*(.w{2,3})+$/.test(myForm.emailAddr.value))
elseif (.test(myForm.emailAddr.value))
{
return (true)
}
alert(“Invalid E-mail Address! Please re-enter.”)
return (false)
}
</script>
I just need to add functionality that will let it pass a zero length string.
Probably very easy if you know how, I however don’t. ?
Thanks in advance.