Welcome to iPadForums.net Guest - Click Here to Register

HTML Select Tag

This is a discussion on HTML Select Tag within the iPad Development forums, part of the iPad App Store category; 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 ...

Register with iPad Forums
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13

Thread: HTML Select Tag

  1. #1
    iPad Noob!
    Member #
    4821
    Join Date
    May 2010
    Posts
    4

    HTML Select Tag

    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

  2. Ads


  3. #2
    iPad Fan!
    Member #
    4354
    Join Date
    May 2010
    Location
    SE PA
    Posts
    22
    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?

  4. #3
    iPad Noob!
    Member #
    4821
    Join Date
    May 2010
    Posts
    4
    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 Code:
    <SELECT NAME="frm_employees_cbo[]" MULTIPLE='multiple' onChange="employee_list_click();"

  5. #4
    iPad Fan!
    Member #
    4354
    Join Date
    May 2010
    Location
    SE PA
    Posts
    22
    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.

  6. #5
    iPad Noob!
    Member #
    4821
    Join Date
    May 2010
    Posts
    4
    Thanks - the onBlur worked perfectly to detect when the Done button is pressed!!

  7. #6
    iPad Noob!
    Member #
    16623
    Join Date
    Oct 2010
    Location
    NY
    Posts
    2

    Question 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.

  8. #7
    iPad Noob!
    Member #
    4821
    Join Date
    May 2010
    Posts
    4
    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.

  9. #8
    iPad Noob!
    Member #
    16623
    Join Date
    Oct 2010
    Location
    NY
    Posts
    2
    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.

  10. #9
    iPad Noob!
    Member #
    33002
    Join Date
    Feb 2011
    Location
    Oslo
    Posts
    2

    Smile 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?

  11. #10
    iPad Fan!
    Member #
    48288
    Join Date
    Apr 2011
    Posts
    6
    Quote Originally Posted by rfresh View Post
    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 Code:
    <SELECT NAME="frm_employees_cbo[]" MULTIPLE='multiple' onChange="employee_list_click();"
    it not good, pls different solutions thanks


Advertisements

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Similar Threads

  1. HTML 5 Magazines...where are they now?
    By Isaac Newton in forum iPad General Discussions
    Replies: 0
    Last Post: 04-01-2010, 10:19 PM

Search tags for this page

.net listbox not rendering in ipad

,
html ipad select 0 items
,

html ipad select open

,

html iphone multi select tag

,
html listbox control splits on iphone
,

html select ipad

,

ipad html select

,

ipad html select multiple

,
ipad onchange not working 4
,
ipad select options size
,
ipad4 html