G
gullyou
Sorry I crossposted this to java group. Didn't know distinction
between Java & Javascript
Hi,
I'm not a Java script programmer but have this web page with a form
form that
includes a field to input an email address. My problem is that the
validator won't allow addresses that include a '.' before the @ sign to
be entered (such as (e-mail address removed))
It seems like (3>intIsDOT-intIsAT) || (4>intLengthA-intIsDOT)){
may be causing the problem. Anyone have an idea that will allow me to
screen out invalid addresses but still allow a . before the @? I would
like to continue using the same script, only modified to allow the '.'
if possible.
Here's the portion of the script that seems to be involved:
function fnEmailValidation(oTag){
var intLengthA= oTag.value.length;
var intIsAT = oTag.value.indexOf("@");
var intIsDOT = oTag.value.indexOf(".");
if (intLengthA<6 || intIsAT<1 ||
(3>intIsDOT-intIsAT) ||
(4>intLengthA-intIsDOT)){
return false;
}
var
strTextAfterDot=oTag.value.substring(intIsDOT+1,intLengthA);
intLengthA= strTextAfterDot.length;
for (var x=0;x<intLengthA;x++){
if
(isNaN(strTextAfterDot.substring(x,x+1))==true) return true;
}
return false;
}
between Java & Javascript
Hi,
I'm not a Java script programmer but have this web page with a form
form that
includes a field to input an email address. My problem is that the
validator won't allow addresses that include a '.' before the @ sign to
be entered (such as (e-mail address removed))
It seems like (3>intIsDOT-intIsAT) || (4>intLengthA-intIsDOT)){
may be causing the problem. Anyone have an idea that will allow me to
screen out invalid addresses but still allow a . before the @? I would
like to continue using the same script, only modified to allow the '.'
if possible.
Here's the portion of the script that seems to be involved:
function fnEmailValidation(oTag){
var intLengthA= oTag.value.length;
var intIsAT = oTag.value.indexOf("@");
var intIsDOT = oTag.value.indexOf(".");
if (intLengthA<6 || intIsAT<1 ||
(3>intIsDOT-intIsAT) ||
(4>intLengthA-intIsDOT)){
return false;
}
var
strTextAfterDot=oTag.value.substring(intIsDOT+1,intLengthA);
intLengthA= strTextAfterDot.length;
for (var x=0;x<intLengthA;x++){
if
(isNaN(strTextAfterDot.substring(x,x+1))==true) return true;
}
return false;
}