In a web application I'm working on, I decided to consolidate a few buttons by turning them into select elements of one dropdown list, with onClick events loading for each option pressed. However, this does not work in iOS (Safari on the iPhone). Is there a different event I can use to grab menu selection from Safari for iPhone?
Somebody's on the ball today... you beat me by 1 second! ps, event names don't use camelCase. This would cause an issue if declaring the event in JavaScript. Better to declare it as `onchange`.
Andy E
2010-07-29 22:31:16
Hah I saw it right after I submitted. I thought it was a tie
webdestroya
2010-07-29 22:32:04
Sorry this is kind of unrelated, but it's better to just have completely lowercase event names? I see most websites recommending thisCase for events.
thenickperson
2010-07-29 22:42:30
Thanks for the suggestion webdestroya and dark_charlie, but onchange doesn't work. Would it be a bad idea to use both at the same time? I want this to work on as many browsers as possible, iOS or not.
thenickperson
2010-07-29 22:47:30
@thenickperson - I am not sure why it is not working... perhaps try `onclick` for each `option` element? I would not have both at the same time (unless you have some sort of flag to make sure they dont run at the same time)
webdestroya
2010-07-30 00:12:35
I already had onclick on all of my option elements. And nevermind about having them at the same time.
thenickperson
2010-07-30 01:03:58
+1
A:
Try onchange:
<select name="foo" onchange="bar();">
<!-- etc. -->
dark_charlie
2010-07-29 22:30:59