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 5 of 5
  1. #1
    New Coder
    Join Date
    Jul 2005
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Display alternate recordset

    Example:
    Table: FRUIT
    column1:
    apple
    bananas
    grapes

    column2:
    I like apples.
    I like bananas.
    I like grapes.

    I'm trying to have it where the choices from column1 are provided on the form, and based on the what was chosen on the form the corresponding choices from column2 are display on the page.

  • #2
    Senior Coder TheShaner's Avatar
    Join Date
    Sep 2005
    Location
    Orlando, FL
    Posts
    1,126
    Thanks
    2
    Thanked 40 Times in 40 Posts
    You're talking about recordsets, so I'm guessing you're pulling this info from a database? So the column1 values are put into a dropdown box and then based on what is selected, you want the DB to populate a second drop down? Are the values from column1 from the DB too, or just the second drop down?

    If this isn't pulling from a DB, you should then refer to this topic in the JS forum: http://codingforums.com/showthread.php?t=67806

    -Shane

  • #3
    New Coder
    Join Date
    Jul 2005
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You described perfectly what I am trying to do...and yes both columns are from the database. So the link u provided does not help.

    Thanks for reply.

  • #4
    Senior Coder TheShaner's Avatar
    Join Date
    Sep 2005
    Location
    Orlando, FL
    Posts
    1,126
    Thanks
    2
    Thanked 40 Times in 40 Posts
    Well, you should still refer to the link I posted. because NikkiH supplies a link in the first reply that would be useful. That link shows a little tutorial that combines Javascript and PHP. Well, you just replace the PHP code with ASP code and there you go! That method provides a way without reloading the page.

    The other way to do it is that you have the first drop down grab the data from the table. Then for the onChange event of that drop down, have it submit the the form. The forms action should be left blank so that it submits to itself. This way, you'd stay on the same page and the second drop down could be populated by what is selected in the first drop down.

    -Shane

  • #5
    Regular Coder
    Join Date
    Aug 2002
    Location
    USA
    Posts
    478
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Possibly somewhat related link requires that the page post back to itself:

    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
    •