- if (document.getElementById("<%=txtEmail.ClientID %>").value == "") {
- alert("Please Enter Email");
- document.getElementById("<%=txtEmail.ClientID %>").focus();
- return false;
- }
- var emailPat = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
- var emailid = document.getElementById("<%=txtEmail.ClientID %>").value;
- var matchArray = emailid.match(emailPat);
- if (matchArray == null) {
- alert("Your Email Address is not valid");
- document.getElementById("<%=txtEmail.ClientID %>").focus();
- return false;
- }
Sunday, 9 November 2014
Validate Email using JavaScript
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment