HTML Select Tag

Discussion in 'iPad Development' started by rfresh, May 20, 2010.

  1. rfresh

    rfresh
    Expand Collapse
    iPF Noob

    Joined:
    May 20, 2010
    Messages:
    4
    Thanks Received:
    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
     
  2. mgamber

    mgamber
    Expand Collapse
    iPF Novice

    Joined:
    May 13, 2010
    Messages:
    22
    Thanks Received:
    0
    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?
     
  3. rfresh

    rfresh
    Expand Collapse
    iPF Noob

    Joined:
    May 20, 2010
    Messages:
    4
    Thanks Received:
    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();">
     
  4. mgamber

    mgamber
    Expand Collapse
    iPF Novice

    Joined:
    May 13, 2010
    Messages:
    22
    Thanks Received:
    0
    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.
     
  5. rfresh

    rfresh
    Expand Collapse
    iPF Noob

    Joined:
    May 20, 2010
    Messages:
    4
    Thanks Received:
    0
    Thanks - the onBlur worked perfectly to detect when the Done button is pressed!!
     
  6. allisonc

    allisonc
    Expand Collapse
    iPF Noob

    Joined:
    Oct 4, 2010
    Messages:
    2
    Thanks Received:
    0
    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.
     
  7. rfresh

    rfresh
    Expand Collapse
    iPF Noob

    Joined:
    May 20, 2010
    Messages:
    4
    Thanks Received:
    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.
     
  8. allisonc

    allisonc
    Expand Collapse
    iPF Noob

    Joined:
    Oct 4, 2010
    Messages:
    2
    Thanks Received:
    0
    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.
     
  9. amar_bbsr

    amar_bbsr
    Expand Collapse
    iPF Noob

    Joined:
    Feb 9, 2011
    Messages:
    2
    Thanks Received:
    0
    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?
     
  10. nirvanatgr

    nirvanatgr
    Expand Collapse
    iPF Noob

    Joined:
    Apr 22, 2011
    Messages:
    6
    Thanks Received:
    0
    it not good, pls different solutions thanks
     

Share This Page



Search tags for this page
angularjs html select not working in iphone
,
html select ipad
,
html select list on ipad
,

html select tag style ipad

,

ipad html select 0 items

,

ipad select option

,
iphone multiselect listbox
,
multi select on safari ipad
,

select tag on ipad

,
when use select box in safari website on ipad 2