Pages

Men

rh

4/10/2013

Email Validation using Javascript with Dotnet

 var emailPat = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
 var emailid=document.getElementById("ctl00$ContentPlaceHolder1$txtEmail").value;
 var matchArray = emailid.match(emailPat);
 if(matchArray == null)
 {
      alert("Please Enter Propoer EmailID");
      document.getElementById('ctl00$ContentPlaceHolder1$txtEmail').focus();
      return false;
  }

No comments :

Post a Comment