All,
I'm trying to do a simple control validation that will pop an alert() and
then move the focus back to the tag. But I can't seem to get the focus() to
work properly. The only browser I can get this function to work properly in
is Opera and if I flip the focus() and alert() lines Opera stops working.
Also is their a way of selecting the whole line(value) when focus is
returned to the control as apposed to having the curser move to in front of
the first character.
Thanks in advance.
CES
function fValidateEmailAddress(sender){
var fName = document.forms[fGetFormName(sender)];
var cValue = fName.elements['id_' + sender].value;
var a = cValue.split("@");
var aText = "Improper Format for an E-Mail Address!"
if ((a.length == 2) && (a[0].length >= 1)){
var b = a[1].split(".");
if ((b.length == 2) && (b[0].length > 1) && (b[1].length > 1)){
fRemoveAsterisk(sender);
}
else{
alert(aText);
//fName.elements['id_' + sender].focus();
}
}
else{
alert(aText);
//fName.elements['id_' + sender].focus();
}
}
name - 05 Nov 2003 08:19 GMT
Yuu need an 'event function'
that
both ways
does it
> All,
>
[quoted text clipped - 31 lines]
> }
> }