function to validate Email address
8
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;
}
}






For example, it returns false for the valid email address foo+bar@gmail.com