Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

email validation - regex

Status
Not open for further replies.

onressy

Programmer
Joined
Mar 7, 2006
Messages
421
Location
CA
Hi :)

I'm having issues with the validation, error states it has something to do with a bracket ')'.

onchange="if(!registrationFrm.frmEmail.value.match(/(^[a-z]([a-z_\.]*)@([a-z_\.]*)([.][a-z]{3})$)|(^[a-z]([a-z_\.]*)@([a-z_\.]*)(\.[a-z]{3})(\.[a-z]{2})*$)/i;){alert('Please enter a valid Email Address.'); document.registrationFrm.frmEmail.focus();return false;}
 
darn this... can't seem to get it working, no errors, just doesn't function, I hoping to validate the email address text field 'frmEmail' with onBlur: //its all on one line unlike below; for easy of reading.

onblur="if(!registrationFrm.frmEmail.value.match(/^[a-z]([a-z_\.]*)@([a-z_\.]*)([.][a-z]{3}$)|(^[a-z]([a-z_\.]*)@([a-z_\.]*)(\.[a-z]{3})(\.[a-z]{2})*$)/i;)

{alert('Please enter a valid Email Address.');

document.registrationFrm.frmEmail.focus();
return false;
}">
 
issue solved, with persistent reworking!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top