Get textbox name from form

Hey everyone,

I have a form that contains multiple textboxes and that are labeled based on their location in a table (ie. 0,0 0,1 1,0 1,1, etc.).

I want to use a javascript that will automatically update the value of that box into a database when that textbox is left (onBlur).

How can get I get the name of the textbox that the user was just on without knowing specifically which one it was? with that i can grab the value and go from there, but i don’t know how to get started here…

Sample of what I’m working with:

<FORM NAME ="updateAssignmentMarks" METHOD ="POST">

<input type="text" onBlur='update(this.form)' name="1,1" value="999" />

Any help is appreciated. I’m very new to javascript. :slight_smile:

Will this work if the user is tabbing through the table? ie. clicks on one box, but then tabs to a different? Would onFocus be an option?

and does this code actually get the name of the field though? i see that it gets the type it is (ie. input, html, etc.), but will this supply the actual name of the textbox?

Thanks for the help!

Okay, i got the field name to work, but this won’t work with tabbing…?

Could i make it work with onBlur, but only for the textboxes?

also, would these values be accessible from my form (so i can send them as parameters to another function)?