I
Iain Downie
Dear list,
we are getting a few folk trying to register for our birdwatching surveys
with emails of the form: (e-mail address removed), in other words with a 4
character ending (other examples are .info).
Currently, I use a regexp to check on 'normal' emails with 3 chars.....
function checkEmail() {
var emailVar = document.shorter.email.value;
if (emailVar.length > 0){
if
(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.shorter.email
..value))
{
return (true)
}
else
{
alert("Invalid E-mail Address! Please re-enter.")
document.shorter.email.select();
}
}
}
Does anyone know of a similar function that can handle the type of e-mail I
described above with 4 chars? My knowledge of what regexp is doing is a tad
limited to say the least (none - looks gibberish to me but it does work
well!)
Cheers
Iain
Dr Iain Downie
British Trust for Ornithology, The Nunnery, Norfolk IP24 2PU, UK
Tel: +44 (0)1842 750050, fax: +44 (0)1842 750030 ® Charity No. 216652
we are getting a few folk trying to register for our birdwatching surveys
with emails of the form: (e-mail address removed), in other words with a 4
character ending (other examples are .info).
Currently, I use a regexp to check on 'normal' emails with 3 chars.....
function checkEmail() {
var emailVar = document.shorter.email.value;
if (emailVar.length > 0){
if
(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.shorter.email
..value))
{
return (true)
}
else
{
alert("Invalid E-mail Address! Please re-enter.")
document.shorter.email.select();
}
}
}
Does anyone know of a similar function that can handle the type of e-mail I
described above with 4 chars? My knowledge of what regexp is doing is a tad
limited to say the least (none - looks gibberish to me but it does work
well!)
Cheers
Iain
Dr Iain Downie
British Trust for Ornithology, The Nunnery, Norfolk IP24 2PU, UK
Tel: +44 (0)1842 750050, fax: +44 (0)1842 750030 ® Charity No. 216652