apparition
Technical User
OK say I have a select box with a bunch of options in it. I have a javascript function that runs when the select is changed (onChange) and goes to another page.
Its all fine and good until you try to navigate the option box without a mouse. Now everytime you tab to the select box and try to press down to see the options, it calls the function and off you go to the next page.
Me thinking that I was smart, change it from onChange to onKeyPress. Well now the keyboard works just fine, but when I use the mouse I actually have to hit a key to get it to work.
The next step naturally was to try onClick. Now when you click with the mouse to see the options, the function is immediately called.
The only solution I could think of was to use the onKeyPress for the keyboard people and for the mouse people, use onClick to change the onChange event.
All that typin and all I really want to know is if I can modify or assign the onChange value of the select box from within its own onClick event?
Any help is good help...
Thanks
Its all fine and good until you try to navigate the option box without a mouse. Now everytime you tab to the select box and try to press down to see the options, it calls the function and off you go to the next page.
Me thinking that I was smart, change it from onChange to onKeyPress. Well now the keyboard works just fine, but when I use the mouse I actually have to hit a key to get it to work.
The next step naturally was to try onClick. Now when you click with the mouse to see the options, the function is immediately called.
The only solution I could think of was to use the onKeyPress for the keyboard people and for the mouse people, use onClick to change the onChange event.
All that typin and all I really want to know is if I can modify or assign the onChange value of the select box from within its own onClick event?
Any help is good help...
Thanks