function emailVal()
{
var strEmail = document.frmCheese.txtEmail.value; //value of entered email addres
var strExp = (/\w+[\.-]?\[email protected]\w+\.\w{3}(\.\w{2})?/) ; //string to test the email address...
var strReg = new RegExp(strExp,"i");
if (strReg.test(strEmail)) //email value checking using
{
checkPw();
}
else
{
window.alert(strReg + "\n" + strEmail );
window.alert("Your emailaddress is invalid. \nPlease enter a correct email address");
document.frmCheese.txtEmail.value = "";
document.frmCheese.txtEmail.focus();
}
}
For a tafe project I am trying to validate the date, the above is my code. Where is the mistake...
Wizz
{
var strEmail = document.frmCheese.txtEmail.value; //value of entered email addres
var strExp = (/\w+[\.-]?\[email protected]\w+\.\w{3}(\.\w{2})?/) ; //string to test the email address...
var strReg = new RegExp(strExp,"i");
if (strReg.test(strEmail)) //email value checking using
{
checkPw();
}
else
{
window.alert(strReg + "\n" + strEmail );
window.alert("Your emailaddress is invalid. \nPlease enter a correct email address");
document.frmCheese.txtEmail.value = "";
document.frmCheese.txtEmail.focus();
}
}
For a tafe project I am trying to validate the date, the above is my code. Where is the mistake...
Wizz