Go Back   CodingForums.com > :: Server side development > ASP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-09-2005, 06:50 PM   PM User | #1
codefantom
New Coder

 
Join Date: Jul 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
codefantom is an unknown quantity at this point
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.
codefantom is offline   Reply With Quote
Old 09-09-2005, 06:57 PM   PM User | #2
TheShaner
Senior Coder

 
TheShaner's Avatar
 
Join Date: Sep 2005
Location: Orlando, FL
Posts: 1,125
Thanks: 2
Thanked 40 Times in 40 Posts
TheShaner will become famous soon enoughTheShaner will become famous soon enough
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
TheShaner is offline   Reply With Quote
Old 09-09-2005, 07:21 PM   PM User | #3
codefantom
New Coder

 
Join Date: Jul 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
codefantom is an unknown quantity at this point
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.
codefantom is offline   Reply With Quote
Old 09-09-2005, 07:48 PM   PM User | #4
TheShaner
Senior Coder

 
TheShaner's Avatar
 
Join Date: Sep 2005
Location: Orlando, FL
Posts: 1,125
Thanks: 2
Thanked 40 Times in 40 Posts
TheShaner will become famous soon enoughTheShaner will become famous soon enough
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
TheShaner is offline   Reply With Quote
Old 09-14-2005, 03:54 AM   PM User | #5
Bullschmidt
Regular Coder

 
Join Date: Aug 2002
Location: USA
Posts: 478
Thanks: 0
Thanked 2 Times in 2 Posts
Bullschmidt is an unknown quantity at this point
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
Bullschmidt is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:39 AM.


Advertisement
Log in to turn off these ads.