Click here to Skip to main content
15,311,104 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
function email()
  if (document.getElementById("<%=txtEmail.ClientID%>").value=="")
                 alert("Please enter your Email ID");
                 return false;

    var emailPat = /^(\".*\"|[A-Za-z]\w*)@(\[\d{1,3}(\.\d{1,3}){3}]|[A-Za-z]\w*(\.[A-Za-z]\w*)+)$/;
     var emailid=document.getElementById("<%=txtEmail.ClientID%>").value;
     var matchArray = emailid.match(emailPat);
     if (matchArray == null)
               alert("Your email address seems incorrect. Please try again.");
               return false;

1 solution

I would go for a regular expression like that :


which will match any string beginning with a digit except 1, followed by 7 to 9 digits.
nityasri 22-Mar-13 20:55pm
thank you

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900