How to create a dynamic drop down menu from a table in your database?

Posted on 2006-04-18
Last Modified: 2010-04-01
Hi, I have a simple table such as

create table A (
column1 varchar(20),
column2 varchar(20)

I want to create a drop down menu selection  like here in this page :

However, here is the trick, i want this menu to update automatically the choice of selection for each and every row I added into the table A.  Thus if table A has 20 row then this menu will have 20 selection.

Can anyone show me how to approach this issue?
Question by:fylix0000
    LVL 11

    Expert Comment

    there are two ways to do it.

    1) using javascript to maintain the dependent dropdown box
    2) using server side roundtrip

    which way do u prefer?

    Author Comment

    The javascript seems like a good starting point...
    LVL 11

    Accepted Solution

    have a look at this.

    at the end of it, there is an initialisation of the array..u need to populate those from the db query.
    Try it and let us know if u find any problems.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
    Digital marketing agencies have encountered both the opportunities and difficulties that emerge from working with a wide-ranging organizations.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    This video discusses moving either the default database or any database to a new volume.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now