| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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. |
![]() |
| Viewing: ASP Free Forums > Programming > Code Bank > Populating Forms |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|