Dependent drop down lists ASP/SQL server

Posted on 2007-10-19
Last Modified: 2008-01-09
I have to build a three tiers dependent drop down lists populated by 3 tables in an SQL server db. The first field is already populated by a value (date) which should serve as the criteria to query from a second data another set of values (courses) on which would depend in turn the value populating the third drop down. First time I would have to do that. I usually only collect the data, in simple ASP forms, which I export in a spreadsheet to process (statistics). Not a coder here. My file is connected to SQL server via DSN/ODBC. I found a few example but I am swamped. Can someone enlighten me by highlighting a plan of what I should look into to get started on that one.
Question by:benoitmarcotte

    Expert Comment

    This is a traditional problem with web applications.  There are two different approaches you can take.

    First.  You can store all the possible values of all three list boxes and use Javascript to modify the contents of the second and third listboxes as the first and second listboxes change.  The benefits of this method is that the page does not have to be reloaded after each listbox change.  The downside is, a lot of data is sent to the browser that may never be displayed.

    Second.  You can reload the page after each listbox change adding a querystring parameter to each load that dictates what the listbox shows.  For example, the first time you load your page, the URL might be mypage.asp?Date=4/5/06 Once a user selects a course, the next call would be mypage.asp?Date=4/5/06&course=ENG101 The benefit of this method is that only the data needed gets sent to the browser.  The drawback is that you have to reload your page.

    I think *most* websites choose the Javascript approach.
    LVL 4

    Expert Comment

    A while back I wrote a script called Dynamic Multiple Select Lists. That script should address what you are after.
    LVL 4

    Accepted Solution

    I also have another Multiple Dynamic Form Select script that uses a combination of ASP, JavaScript and AJAX to display the options that may help you solve what you are trying to do:

    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.

    Join & Write a Comment

    This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
    Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
    This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
    Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

    746 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

    16 Experts available now in Live!

    Get 1:1 Help Now