Click to See Complete Forum and Search --> : grab form field name


miller
01-30-2003, 08:33 PM
i have a form with several input text fields.
all have this event included:

onBlur="IsNumeric(this.value)"

below is the funtion it calls. my question:
is there a way to grab the name of the
input field from where IsNumeric is called
and then use it to focus back on?:confused:

thanks in advance:)

//---------------
function IsNumeric(sText)
{
var ValidChars = "0123456789 ";
var IsNumber=true;
var Char;


for (i = 0; i < sText.length && IsNumber == true; i++)
{
Char = sText.charAt(i);
if (ValidChars.indexOf(Char) == -1)
{
alert("Please use numbers only.");
IsNumber = false;
}
}
return IsNumber;
}

miller
02-01-2003, 02:56 PM
thanks for the speedy reply,
mine, however, a bit tardy.

ok then this is how noob i am:
trying to make the cursor focus in the same field:

document.bform.[fldObj.value].focus();

obviously, this is no good nor are
the others ive done.
what's the proper syntax in this case?

cheers

miller
02-02-2003, 01:49 PM
that hit the spot.

thanks again, mr Clark!!