Reputation: 2788
Hi i have this in a html page android(2.1) webkit
<SELECT id="my_id" onclick="my_click();" > </SELECT>
If you click on the combo box an empty list is displayed on android emulator.
I do not want to display a empty list , if its empty. I want to intercept this in the on click event. The onclick event is not firing. The onchange event is working. only the onchange event fires , onmousedown, onmouseup etc don't fire.
This works in chrome and in iphone webkit ..
anyideas? mike
Upvotes: 0
Views: 1482
Reputation: 22899
I don't know that you can capture the onclick event for a select list, since that event only actually fires once an option is selected (in Android's webkit, that is...iPhone and Chrome webkit engines don't process the event the same way). However, you could take another route; the idea is to hide the list if it's empty, so do something like this to count the number of options:
$('#my_id option').size();
...then set display:none
if the returned value is less than 1.
Upvotes: 1