Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

ASP and SQL

Options
  • 14-07-2004 1:38pm
    #1
    Registered Users 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 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 Posts: 937 ✭✭✭Diddy Kong


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


Advertisement