Menu
Hi There,
Thisjavascript is partially working. It will not submit the form if there is neither a . or a @ symbol, and will submit it if there is a @ symbol, which means it isn’t checking for dots. When I enter something like kim. it prompts the user for an email address. I don’t understand why it seems to be validating in part.
var chartr = /@/i
var dot = /./i
if (document.detailsform.email.value.search(dot) == -1)
{
alert (“Please enter a valid email address.”);
return false;
}
if (document.detailsform.email.value.search(chartr) == -1)
{
alert (“Please enter a valid email address.”);
return false;
}