Email Validation in javascript


Email address validation in javascript. Check below example……….
============================================================================================================================

Email Validation Test

Email Address

function emailValidate(obj){
if(obj.email.value == “”){
alert(“Enter email address”);
obj.email.focus();
return false
}
if(obj.email.value != ”){
var emailLetter = /^[a-zA-Z0-9.-_]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
if(!emailLetter.test(obj.email.value)){
alert(“Email address not valid.”);
obj.email.value = ”;
obj.email.focus();
return false;
}
}
}

============================================================================================================================

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s