Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

ASP and SQL

  • 14-07-2004 01:38PM
    #1
    Registered Users, Registered Users 2 Posts: 937 ✭✭✭


    Hi,
    I have a few SQL tables, and i want to create an asp page to access these databases, what i want a user to be able to do is, based on 2 dropdown list (populated from 2 sql tables), display information on the page, not in a recordset, (i want to be able to place the results in certian places), so far, i have one of the drop downs populated, but im stumped at that, how do i use the onChange command to populate the next dropdown??

    any ideas/help with this much appreciated


Comments

  • Registered Users, Registered Users 2 Posts: 15,443 ✭✭✭✭bonkey


    In the onChange of the one you have populated (the first combo) you do the following :

    1) Read what value is selected in the firest combo, and retrieve the relevant data (from the DB?) based on this value.
    2) Clear the second combo
    3) Populate the second combo with the info

    Because this approach is often ugly from a performance setup - especially when you use a combo-box in certain ways from the keyboard - I've often seen code in use which pulls down *all* sets of values for the second combo as arrays in the browser-side code, and then populates the second combo without having to do a roundtrip to the server.

    Its a bit more work, and increases the page-size, but it does mean that changing your selection in the first combo doesn't require a round-trip.


  • Registered Users, Registered Users 2 Posts: 937 ✭✭✭Diddy Kong


    sounds like the way to do it, any sites on actually how to do this


Advertisement