Hi, I need help with registration forms. There are two text fields for (email and business website url address).
when person sign up and put website url address, and the email extension address should be match with the website extension address.
For sample that company website name www.amazon.com, and employee email should "xxxx@amazon.com".
How can i write the validation code to prevent continue process if website extension address are not same as email extension address!
pleae help thanks.
AM
email validation
Moderator: General Moderators
-
mike_ebrahimi123
- Forum Newbie
- Posts: 3
- Joined: Mon Mar 14, 2011 3:57 pm
Re: email validation
function validate(form_id,email) {
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
var address = document.forms[form_id].elements[email].value;
if(reg.test(address) == false) {
alert('Invalid Email Address');
return false;
}
}
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
var address = document.forms[form_id].elements[email].value;
if(reg.test(address) == false) {
alert('Invalid Email Address');
return false;
}
}