I have a select box that is multiple rows using the size attribute. I don't always fill all of the available rows. I have a function bound to onClick. It was originally onChange, but that didn't work for the initial clicking.
Anyways, I need to determine if the user clicked on an actual valid row, or just on the empty space in the select tag. I've tried checking if the selection is null, but I couldn't get that to work. How can I check this? Thanks.
Eric Pascarello wrote:onchange will not fire if the values have not changed. Hence if the user selects the same value,nothing has changed.
You should use onblur.
onChange wasn't fired at all on the initial change. I would have to select two or three different options before it would initially fire.
I tried onBlur, but it didn't seem to do anything at all.
And I still can't get anything to fire if I use the keyboard.
EDIT: I tried onBlur and it didn't do anything, so I changed it to blur. That worked, but it's not the workflow I need. I need to have the user click on an option and have that fire an event. So far .click is the only thing I've found that will do that. I just need to determine if it's a valid selection or not.