Please could anyone help I need a validation script on and input field
email to include/exclude the below?
If it is even possible even??
Many Thanks in advanced, Regards, Jason
-----------------------------------------------------------------------------
(Note " * " is NOT a wildcard in the instances below)
include:
a-Z 0-1 * _ - @ a-Z 0-1 _ - . a-Z 0-1
exclude:
*@hsbc.com
*@barclays.com
*@hotmail.com
-----------------------------------------------------------------------------
if (theForm.email. value == "")
{
alert("Please enter a valid email");
theForm.email.f ocus();
return (false);
}
var checkemail = "@.";
var checkStr = theForm.email.v alue;
var emailValid = false;
var emailAt = false;
var emailPeriod = false;
for (i = 0; i < checkStr.length ; i++)
{
ch = checkStr.charAt (i);
for (j = 0; j < checkemail.leng th; j++)
{
if (ch == checkemail.char At(j) && ch == "@")
emailAt = true;
if (ch == checkemail.char At(j) && ch == ".")
emailPeriod = true;
if (emailAt && emailPeriod)
break;
if (j == checkemail.leng th)
break;
}
if (emailAt && emailPeriod)
{
emailValid = true
break;
}
}
if (!emailValid)
{
alert("Please enter a valid email");
theForm.email.f ocus();
return (false);
}
-----------------------------------------------------------------------------
<form name="whitelist " method="post" action="submit. php">
<input name="email" type="text" id="email"
onblur="lowerCa se(this.id)">
<i>user@company .com (*@company.com = anything)</i><br>
<i>Please do <font color="red">NOT </fontadd <u>*@hotmail.co m</u,
only to company domains eg. <u>*@scruttonbl and.co.uk</u></i><br>
<i>Also please <font color="red">exc lude</fontBank email addresses
(@rbs.co.uk @barclays.co.uk @lloydstsb.com @hsbc.co.uk @natwest.com)</
i><br>
<input name="submit" type="submit" id="submit" value="Submit">
email to include/exclude the below?
If it is even possible even??
Many Thanks in advanced, Regards, Jason
-----------------------------------------------------------------------------
(Note " * " is NOT a wildcard in the instances below)
include:
a-Z 0-1 * _ - @ a-Z 0-1 _ - . a-Z 0-1
exclude:
*@hsbc.com
*@barclays.com
*@hotmail.com
-----------------------------------------------------------------------------
if (theForm.email. value == "")
{
alert("Please enter a valid email");
theForm.email.f ocus();
return (false);
}
var checkemail = "@.";
var checkStr = theForm.email.v alue;
var emailValid = false;
var emailAt = false;
var emailPeriod = false;
for (i = 0; i < checkStr.length ; i++)
{
ch = checkStr.charAt (i);
for (j = 0; j < checkemail.leng th; j++)
{
if (ch == checkemail.char At(j) && ch == "@")
emailAt = true;
if (ch == checkemail.char At(j) && ch == ".")
emailPeriod = true;
if (emailAt && emailPeriod)
break;
if (j == checkemail.leng th)
break;
}
if (emailAt && emailPeriod)
{
emailValid = true
break;
}
}
if (!emailValid)
{
alert("Please enter a valid email");
theForm.email.f ocus();
return (false);
}
-----------------------------------------------------------------------------
<form name="whitelist " method="post" action="submit. php">
<input name="email" type="text" id="email"
onblur="lowerCa se(this.id)">
<i>user@company .com (*@company.com = anything)</i><br>
<i>Please do <font color="red">NOT </fontadd <u>*@hotmail.co m</u,
only to company domains eg. <u>*@scruttonbl and.co.uk</u></i><br>
<i>Also please <font color="red">exc lude</fontBank email addresses
(@rbs.co.uk @barclays.co.uk @lloydstsb.com @hsbc.co.uk @natwest.com)</
i><br>
<input name="submit" type="submit" id="submit" value="Submit">
Comment