Dec 1, 2010

Check Email Id

if(email.trim()=="")
                {
                 alert("Kindly enter valid Email Address");
                document.getElementById("<%=textemail.ClientID %>").focus();
                return false;
                }
           
         var emailPat =/^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/;
    // var emailPat = /^([\w\d\-\.]+)@{1}(([\w\d\-]{1,67})|([\w\d\-]+\.[\w\d\-]{1,67}))\.(([a-zA-Z\d]{2,3})(\.[a-zA-Z\d]{2})?)$/;
     var emailid=document.getElementById("<%=textemail.ClientID %>").value;
     var matchArray = emailid.match(emailPat);
     if (matchArray == null)
    {
               alert("Please enter valid Email Address.");
               document.getElementById("<%=textemail.ClientID %>").focus();
               return false;
    }

No comments:

Post a Comment

What is the use of n-tier architecture and 3-tier architecture?

how to implement 3-tier architecture in asp.net using c#. 3-Tier architecture is also called layered architecture. Some people called it ...