How to Handle Variable Number of Items with <select>

Discussion in 'HTML' started by Peter Lauren, May 2, 2011.

  1. Peter Lauren

    Peter Lauren Guest

    I can make a drop down select list thus.

    <select>
    <option value="lion">Lion</option>
    <option value="tiger">Tiger</option>
    <option value="cheetah">Cheetah</option>
    <option value="leopard">Leopard</option>
    </select>

    However it is fixed at 4 specific items. How would I modify the
    select block that that I could handle and number of items, with any
    number of different names such as from a database.

    Many thanks in advance for any help,
    Peter.
    Peter Lauren, May 2, 2011
    #1
    1. Advertising

  2. Peter Lauren

    Peter Lauren Guest

    On May 1, 10:11 pm, wayne <> wrote:
    > On 05/01/2011 06:29 PM, Peter Lauren wrote:
    >
    > > I can make a drop down select list thus.

    >
    > > <select>
    > > <option value="lion">Lion</option>
    > > <option value="tiger">Tiger</option>
    > > <option value="cheetah">Cheetah</option>
    > > <option value="leopard">Leopard</option>
    > > </select>

    >
    > > However it is fixed at 4 specific items.  How would I modify the
    > > select block that that I could handle and number of items, with any
    > > number of different names such as from a database.

    >
    > > Many thanks in advance for any help,
    > > Peter.

    >
    > I believe you can add as many <option> tags as you need.http://htmlhelp.com/reference/html40/forms/select.html
    >
    > If you want to populate from a database:http://www.kirupa.com/forum/showthread.php?t=287765
    >
    > --
    > Wayne
    > One of the great tragedies of mankind is that morality has been hijacked
    > by religion. — Arthur C. Clarke


    Thanks very much for your help. I used the database approach and it
    works great! Sorry about my tardy reply. I was held up with the
    issue of uploading multiple files. I have now resolved that issue.

    Thanks again,
    Peter.
    Peter Lauren, May 15, 2011
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lambda
    Replies:
    2
    Views:
    334
    Lambda
    Jul 3, 2008
  2. Pranjal Jain
    Replies:
    3
    Views:
    142
    saras
    Apr 10, 2008
  3. Joe Pizzanley
    Replies:
    3
    Views:
    113
    Colin Bartlett
    Sep 2, 2010
  4. palmiere
    Replies:
    1
    Views:
    378
    Erwin Moller
    Feb 9, 2004
  5. Gumtree
    Replies:
    3
    Views:
    237
    Matt Kruse
    Nov 10, 2004
Loading...

Share This Page