Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2005

    Unanswered: Populating a combo based on another combo

    I want to populate a combo that based on another combo.
    For example, If i select country from the first combo, the second combo automatically fills with its cities.
    Please if anybody can write the code ...

  2. #2
    Join Date
    Jan 2005
    You could have a db with 2 tables - one is countries, the other is cities.

    In the cities table - have a column 'country' that references the countries table.

    On your web page, pull countries from the db, and cities for that country to populate your 2 drop down menu's

    Using javascript - onChange the country selector - reload the page with the value of the country sent in a query.

    It should be really easy to do it - assuming you have some asp / sql / js knowledge.

  3. #3
    Join Date
    Jun 2003
    Perhaps this may hopefully give you some ideas. It's got a downloadable sample and does retain values after the post back:

    Classic ASP Design Tips - Dependent Listboxes
    J. Paul Schmidt, Freelance Web and Database Developer
    Access Database Sample, Web Database Sample, ASP Design Tips

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts