JavaScript Email Validation

Lakhangarg
Posted by Lakhangarg under JavaScript category on | Views : 2577
Method To validate Email ID With the Help of Regular Expression.

function check for valid email address
function IsvalidEmail(src)
{
var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
var regex = new RegExp(emailReg);
return regex.test(src);
}


Remove White Space from Start and From End
TrimString=function(str) 
{
str = this != window? this : str;
return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
}

Comments or Responses

Login to post response