What's new
Apple iPad Forum 🍎

Welcome to the Apple iPad Forum, your one stop source for all things iPad. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

HTML Select Tag

rfresh

iPF Noob
Joined
May 20, 2010
Messages
4
Reaction score
0
I'm writing a web app that runs on the iphone/iPad. I have a listbox with an onChange() javascript event. I notice listboxes on Safari on the iphone/ipad do not fire on the onChange() event. What event should I be using if not onChange? or is there a trick to detecting the onChange() event?

Thanks
 

mgamber

iPF Noob
Joined
May 13, 2010
Messages
22
Reaction score
0
Location
SE PA
Sure it does!

<html>
<body>
<select onChange="alert('test');">
<option>Select an option</option>
<option>Option 1</option>
<option>Option 2</option>
<option>Option 3</option>
</select>
</body>
</html>

That worked fine for me on iPad's Safari. Sure you're using the correct tags and there's not a javascript error in there somewhere?
 
OP
R

rfresh

iPF Noob
Joined
May 20, 2010
Messages
4
Reaction score
0
I think the difference is that my SELECT is a multiple selection listbox. When I select items in the list and then touch the Done button in the list, the list goes away but the JS function does not fire.

PHP:
<SELECT NAME="frm_employees_cbo[]" MULTIPLE='multiple' onChange="employee_list_click();">
 

mgamber

iPF Noob
Joined
May 13, 2010
Messages
22
Reaction score
0
Location
SE PA
Ah yes, I see it with the multiple tag. The cheap "solution" would be to replace the onChange event with onBlur which still works. The better solution would be to investigate the onTouch... events and determine how to detect when a list item is changed, the Done button is tapped or something else is tapped which closes the list.
 
OP
R

rfresh

iPF Noob
Joined
May 20, 2010
Messages
4
Reaction score
0
Thanks - the onBlur worked perfectly to detect when the Done button is pressed!!
 

allisonc

iPF Noob
Joined
Oct 4, 2010
Messages
2
Reaction score
0
Location
NY
Options Aren't Showing Up until I click the select element

I have a multi select form element:

Code:
<select  id="something" name ="something" onchange="something();" multiple="multiple" >
<option value="something">something</option>
<option value="somethingelse">something else</option>
</select>

On the ipad, the options aren't showing until I click the select element. Before I do that it says "0 Items".

Any idea why? How to fix this? (BTW it works normally on a computer browser (IE, FF, Safari, Chrome, just not on the ipad)

Thanks.
 
OP
R

rfresh

iPF Noob
Joined
May 20, 2010
Messages
4
Reaction score
0
I don't there is a way to do that. Until you manually select (or programatically select via Javascript) items, it shows 0, which in the iPad case, means no selections. 0 doesn't mean there are no items in the list, it means no items have been selected.
 

allisonc

iPF Noob
Joined
Oct 4, 2010
Messages
2
Reaction score
0
Location
NY
Okay, that's fine, if that's the default behavior. I haven't been able to find a guide to any of this stuff, so I'm just trying to figure things out as I go. Thanks.
 

amar_bbsr

iPF Noob
Joined
Feb 9, 2011
Messages
2
Reaction score
0
Location
Oslo
asp.net Listbox does not render in ipad

The Asp.net list control renders like a dropdown control safari ipad. What is the solution for it?
 

nirvanatgr

iPF Noob
Joined
Apr 22, 2011
Messages
6
Reaction score
0
I think the difference is that my SELECT is a multiple selection listbox. When I select items in the list and then touch the Done button in the list, the list goes away but the JS function does not fire...

PHP:
<SELECT NAME="frm_employees_cbo[]" MULTIPLE='multiple' onChange="employee_list_click();">

it not good, pls different solutions thanks
 

udhayamoorthy

iPF Noob
Joined
Mar 17, 2012
Messages
1
Reaction score
0
Location
India
Did you find any solution for this multi select form problem in ipad?. kindly share your ideas..
 

kgu87

iPF Noob
Joined
Mar 20, 2012
Messages
2
Reaction score
0
If you insist on using select tag, search google for
jquery tochecklist plugin.

Otherwise you can implement it via ul with images and CSS/js for a more native look and feel.
 
Last edited:

udhaya

iPF Noob
Joined
Apr 11, 2012
Messages
1
Reaction score
0
Location
india
Hi allisonc,

Did you found any solutions for this 0 items problem??
 

Most reactions

Latest posts

Top