I have 2 page:
index.aspx
next.aspx
and the code in javascript to validate Email:
When you click in button, I want to test email valid then link to next.aspx page,
but It's not test validate and link to next.aspx? I don't know why and how to fix this bug.
Can you help me for the purpose: testing email and link to next.aspx page?.
Thanks
index.aspx
next.aspx
and the code in javascript to validate Email:
Code:
function fnEmail()
{
if(checkEmail(form1.txtEmail.value)== false)
{
alert("Email is not valid!");
form1.txtEmail.focus();
return false;
}
return true;
}
function checkEmail(mail)
{
mail = trim(mail);
var re=/^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,4}$/
if(mail.match(re) == null)
return false;
return true;
}
function trim(sString)
{
while (sString.substring(0,1) == ' ')
{
sString = sString.substring(1, sString.length);
}
while (sString.substring(sString.length-1, sString.length) == ' ')
{
sString = sString.substring(0,sString.length-1);
}
return sString;
}
and the <input>:
<a id="linknext" href="next.html"><input type="button" onclick="return fnEmail();" class="NextButton" width="56" height="27"
style="WIDTH: 56px; HEIGHT: 27px"> </a>
but It's not test validate and link to next.aspx? I don't know why and how to fix this bug.
Can you help me for the purpose: testing email and link to next.aspx page?.
Thanks
Comment