grab form field name

admin

Administrator
Staff member
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;
}
 
Back
Top