Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Senior Coder
    Join Date
    May 2004
    Posts
    1,441
    Thanks
    15
    Thanked 0 Times in 0 Posts

    dynamic select boxes

    I need to have 3 select boxes on a page.
    Pulling info from a database but once someone selects something in the first box -- it then queries the second box based on the first and then the same for the third.

    What's the best method to do this?

  • #2
    Regular Coder
    Join Date
    Jun 2003
    Location
    Silicon Forest
    Posts
    155
    Thanks
    0
    Thanked 5 Times in 5 Posts
    I assume this is while the client is using it, so probably something client side like Javascript. You populate the forms with the ASP, then Javascript would tell it which to display.

    OR

    If you want to just use ASP, you would need to submit each select box, which would be really annoying to the client.
    Whats the point of a signature?

  • #3
    Senior Coder
    Join Date
    May 2004
    Posts
    1,441
    Thanks
    15
    Thanked 0 Times in 0 Posts
    yes but it's dynamic as it queries the database differently based on the first checkbox.

  • #4
    Regular Coder
    Join Date
    Jun 2003
    Location
    Silicon Forest
    Posts
    155
    Thanks
    0
    Thanked 5 Times in 5 Posts
    Well, the problem with that is that you have to keep calling the db, which requires a refresh of the page to submit form info. However, if you just dump all your information that could be displayed in the page into some javascript functions, you could change the other text boxes based on what is in your database.
    Whats the point of a signature?

  • #5
    teh Moderatorinator
    Join Date
    Sep 2004
    Location
    USA
    Posts
    2,472
    Thanks
    4
    Thanked 40 Times in 40 Posts
    I think you're looking for the same thing as this thread:
    running DB hit when drop-down is selected

    Good luck

  • #6
    Regular Coder
    Join Date
    Aug 2002
    Location
    USA
    Posts
    478
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Perhaps this may hopefully give you some ideas. It's got a downloadable sample with 2 listboxes but the same principle could be applied to add a third and does retain values after the post back (although it is admittedly somewhat complicated):

    Classic ASP Design Tips - Dependent Listboxes
    http://www.bullschmidt.com/devtip-de...tlistboxes.asp
    J. Paul Schmidt
    www.Bullschmidt.com - Freelance Web and Database Developer
    www.Bullschmidt.com/DevTip.asp - Classic 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
    •