Limitthe number of visible items in dropdown list

Discussion in 'JavaScript' started by Turnkey Websites, Sep 2, 2009.

  1. #1
    How can I limit the number of displayed items in dropdown list? for example a list of countries, i want to show only 5 or 7 countries, then users can scroll to see the rest.

    is it doable with javascript? css? any way?

    Thanks
     
    Turnkey Websites, Sep 2, 2009 IP
  2. lp1051

    lp1051 Well-Known Member

    Messages:
    163
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #2
    Hi,
    do you mean something like:
    <select name="country" size="5">
     ... list of options (countries)
    </select>
    HTML:
    Then it's just HTML...
     
    lp1051, Sep 2, 2009 IP
  3. Turnkey Websites

    Turnkey Websites Peon

    Messages:
    65
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Nope, for example in this facebook form : http://www.facebook.com/ in the birthday, in the Day, when you click the arrow, you see 19 days, then you can scroll to see more. what if I want to show only 10 days there and people can scroll for more?
     
    Turnkey Websites, Sep 2, 2009 IP
  4. lp1051

    lp1051 Well-Known Member

    Messages:
    163
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #4
    Ok, I see. As far as I know the way how drop down list is displayed, is based on browser and OS. At least classic select tag. You could accomplish it by custom javascript drop down list, but it's too much code to write here. Good start is google for 'javascript drop down list'. If you chose some code and have problems, just share it here...
     
    lp1051, Sep 2, 2009 IP