Rod Early wrote:
I need to know when the select element's dropdown list is opened (as
when the user clicks on the arrow or does ALT-downarrow from the
keyboard). Similarly, I need to known when the dropdown list closes.
The closing of the dropdown list can happen without changing the
dropdown, hence the onchange event is not a sure way to determine that
the dropdown list closed.
Is this possible in Internet Explorer?
Thanks,
Rod
You only think you need to know when the drop-down list closes.
The drop-down list closes when some other element on the page receives
focus. So, trap focus on the item that the user is going to click after
selecting something from the drop-down menu:
<select name="mySelect">
<option value="1">One</option>
<!-- etc -->
</select>
<input type="button" name="myButton"
onclick="alert('The drop-down menu has closed, the value is ' +
this.form.mySelect.options[this.form.mySelect.selectedIndex].value);"
/>
--
| Grant Wagner <gw*****@agricoreunited.com>
* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html
* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp
* Netscape 6/7 DOM Reference available at:
*
http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
*
http://www.mozilla.org/docs/web-deve...upgrade_2.html