PDA

Click to See Complete Forum and Search --> : Is there a way to fire javascript in a table onBlur?


msimmons
Feb 21st, 2002, 11:49 AM
I have a table that has elements in it (inputboxes, checkboxes, comboboxes) and right now I have an onBlur in each element that runs a script to update the value of the elements to the database. To be more efficiant I wanted to see if I could update the database when the user leaves the table rather than each element in the table. I tried to do a test with the onBlur of the table but it didnt fire so I was wondering if it was even possible... anyone know?
Thanks
Michael

CiberTHuG
Feb 21st, 2002, 12:01 PM
http://www.w3.org/TR/html4/struct/tables.html#h-11.2.1

I imagine that the triggers are reserved for form elements, since a table won't really ever have focus, much less loose it.

CiberTHuG
Feb 21st, 2002, 12:04 PM
Sorry, this page helps more...

http://www.w3.org/TR/html4/interact/scripts.html#events


onfocus = script [CT]
The onfocus event occurs when an element receives focus either by the pointing device or by tabbing navigation. This attribute may be used with the following elements: A, AREA, LABEL, INPUT, SELECT, TEXTAREA, and BUTTON.

onblur = script [CT]
The onblur event occurs when an element loses focus either by the pointing device or by tabbing navigation. It may be used with the same elements as onfocus.

msimmons
Feb 21st, 2002, 12:06 PM
ok thanks,
thats what I was afraid of... no problem though, i'll just keep it the way it is.
Thanks again,
Michael