function to validate Email address





8
Date Submitted Fri. Aug. 4th, 2006 10:17 AM
Revision 1 of 1
Syntax Master sundaramkumar
Tags JavaScript
Comments 1 comments
function to validate Email address


function fnValidateEmail(strValue) {
        strValue = strValue.ltrim()
        strValue = strValue.rtrim()
        var str = strValue;
        if(strValue.length <=0) return false;
        if (str.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z]+$/) != -1){
          return true;
        }
        else{
          return false;
        }
}

 

Comments

Comments Wrong regexp
Sun. Oct. 29th, 2006 12:18 PM    Scripter SCoon

Voting