Click to See Complete Forum and Search --> : <select> problem


Webskater
12-05-2003, 04:13 AM
I have a select box which is populated by a couple of functions depending on which button is clicked. So ButtonA causes ListA to be displayed and ButtonB displays ListB.
If the select box has the focus and is displaying (for example) List A i.e. it is in a dropped-down state and I click ButtonB to display ListB, it does not work. Clicking ButtonB causes the select box to stop displaying the list (i.e. it is no longer in a dropped-down state) but the function to change the list does not run. If you click the button again it does.
So, the function does not run when the select box is in a dropped-down state.
Can anyone tell me how to get over this? Is it possible to detect the state of a select box?

Gollum
12-05-2003, 04:28 AM
I don't think so. I think this is a behaviour of the combo-box control. While it is dropped down, nothing else on the page can take the focus (kind of like a modal window). If you click outside the dropdown area, it takes that as a cancel and un-drops the list but the click is otherwise ignored.

Webskater
12-05-2003, 05:16 AM
Thanks for your answer. The thing I do not understand is that when I click on a button (my button is a hyperlink) when the combo box is down, the hyperlink knows it has been clicked because it changes to the 'visited' colour. So the hyperlink knows it has been clicked but the onclick event did not fire.