Validate Email Address Using JavaScript

Following code used to validate the email address.

function IsEmail(email) {
     var regex = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]  {2,4})+$/;
    return regex.test(email);
Example :
We can test email address by above function like :
This function return boolean value , it will return either true or false based on the validation test.
If user has supplied wrong email address then it  will return false otherwise return true.

 IsEmail(""); -->    output : true
 IsEmail("")               -->    output : false

posted under |


Post a Comment

Please provide your valuable comment.

Newer Post Older Post Home


Powered by Blogger.


Custom Search