Drop Down Menus on Mobile Phone Sites

Discussion in 'HTML & Website Design' started by travoholic, May 31, 2008.

  1. #1
    Hey,

    I'm working on my first ever site for mobile phone users and I'm having problems getting my drop down menu to show up. I realised that I'm not even sure if they'll work on mobiles.

    I'm just trying to do a simple drop down menu like this:

    <form>
    <select>
    <option>Choose an item:
    <option value="./page1.htm">Option 1
    <option value="./page2.htm">Option 2
    </select>

    <input type="submit" value="Submit">

    </form>

    Will these work at all? Is there another way to do them? I've been using the tester on http://dev.mobi and can't get the drop down to appear.

    Thanks!
    Kirsty
     
    travoholic, May 31, 2008 IP
  2. itcn

    itcn Well-Known Member

    Messages:
    795
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    118
    #2
    It should work - try closing your option tags:

    <form>
    <select>
    <option>Choose an item:</option>
    <option value="./page1.htm">Option 1</option>
    <option value="./page2.htm">Option 2</option>
    </select>

    <input type="submit" value="Submit">

    </form>
     
    itcn, May 31, 2008 IP
  3. travoholic

    travoholic Well-Known Member

    Messages:
    299
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    108
    #3
    Thanks, I'll give it a go!
     
    travoholic, May 31, 2008 IP
  4. travoholic

    travoholic Well-Known Member

    Messages:
    299
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    108
    #4
    Hrm... when I close the option tag the page doesn't display at all, it comes up with an error. Without them closed the page shows up but without the drop down menu.

    any other suggestions?
     
    travoholic, May 31, 2008 IP
  5. travoholic

    travoholic Well-Known Member

    Messages:
    299
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    108
    #5
    Here's my test site: http://www.travoholic.com/test.html and I'm trying to get it to work with the moblie tester on http://dev.mobi but it won't show the drop down.

    If someone could take a look at my site to see what else I can try I would really appreciate it!!
     
    travoholic, May 31, 2008 IP
  6. itcn

    itcn Well-Known Member

    Messages:
    795
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    118
    #6
    I justed tested it and it failed on 2 things;

    So you have to close the option tags, and you have to specify an action for the form in order for the drop down to work; something like:
    <form action="mypage.php" method="post">
     
    itcn, May 31, 2008 IP
  7. itcn

    itcn Well-Known Member

    Messages:
    795
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    118
    #7
    You can see these messages yourself; underneath the emulator look at "Dotmobi compliance tests"
     
    itcn, May 31, 2008 IP
  8. travoholic

    travoholic Well-Known Member

    Messages:
    299
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    108
    #8
    Thanks for that. I didn't totally understand them all. For the "action" for the form... all I want to happen is for the form to go to the URL for whichever thing on the dropdown menu is chosen. What should I put in as the action? Thanks again!!
     
    travoholic, May 31, 2008 IP
  9. hanushh

    hanushh Peon

    Messages:
    198
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #9
    you need to write the php or javascript code for that. if you need the code pm me. i can write it for u
     
    hanushh, Jun 1, 2008 IP
  10. itcn

    itcn Well-Known Member

    Messages:
    795
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    118
    #10
    itcn, Jun 1, 2008 IP
  11. DjChugg

    DjChugg Active Member

    Messages:
    362
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    85
    #11
    try this code, maybe it can help you/...

    <form name="Drop down">
    <select style="font-size:12px;color:#006699;font-family:verdana;background-color:#ffffff;" name="menu">
    <option value="http://test.com">test</option>
    <option value="http://me.com">me</option>
    <option value="http://testme.com">testme</option>
    </select>
    <input style="font-size:12px;color:#ffffff;font-family:verdana;background-color:#006699;" type="button" onClick="window.open(document.Drop down.menu.options[document.Drop down.menu.selectedIndex].value);" value="click here">
    </form>
    
    Code (markup):
     
    DjChugg, Jun 1, 2008 IP