Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old July 16th, 2004, 01:27 AM
pick1e pick1e is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 5 pick1e User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Populating Forms

Hey all. I posted a question here a week or so ago and you helped me solve my problem, so I thought I'd try another one!

I'm a newbie btw.

Here's what I have: a page where the user enters products in fields to be stored in an access database, including name, description, price, all that good stuff. One thing that bugs me is the "Category" and "Subcategory" inputs. Right now the subcategory field displays ALL subcategories, not just the ones under the chosen category... For example:

Categories:
Apples
Oranges
Plums
Subcategories:
Apples - Red
Apples - Yellow
Oranges - Large
Oranges - Medium
Oranges - Small
Plums - Yummy
Plums - Yucky

As it is, if you chose your category "Apples", you still get all the subcategories, and it relies on the user to be smart enough to choose an appropriate subcategory - not always the case. I want it so if you chose category Apples, the only subcategory options you will see will be Red and Yellow.

I see this done all the time, but whether it can be done with just ASP I don't know. Any ideas? I've tried looking around for some help but it's hard to search when I don't know what it is called. Does this format have a name? I would like to stick to just ASP if it will be possible; I'd like to get half way decent with one language before starting another hehehe.

Thanks in advance-
Justin

Reply With Quote
  #2  
Old July 16th, 2004, 04:28 AM
bamboo bamboo is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 168 bamboo User rank is Private First Class (20 - 50 Reputation Level)bamboo User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Since you want to stick with ASP I'll discuss selecting a category and then redisplaying the page with the subcategory list. If you are talking about selecting a category and having the subcategory list changed without displaying the page search google for MULTIPLE PULLDOWNS
Do you have a category table?

Do you have a subcategory table?

If so, do you have a link between the two? For example:

Category
CategoryId
Name

Subcategory
SubcategoryId
CategoryId
Name

Let's say the form SELECT is <SELECT NAME=CategoryId SIZE=1> which passes the CategoryId of the selected item to the action file.

In the SQL statement in the action file you would have

Select CategoryId, Name From Subcategory WHERE CategoryId = " & Request.Form("CategoryId")

Then use the resulting recordset in your subcategory pulldown list.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingCode Bank > Populating Forms


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT