Thursday, January 6, 2011

A simple JavaScript Email Validation

This function will validate the e-mail address
function ValidateEmail(emailid)
   {
        
        var RegExEmail = /^(?:\w+\.?)*\w+@(?:\w+\.)+\w+$/;
        if (!RegExEmail.test(emailid.value))
        {
            //alert("The E-mail address entered is not valid!");
            return true;
        }
        else
        {            
            return false;
        }
       
   }