Re: Filtering Pulldown Select Lists

by Frank Boumphrey <bckman(at)ix.netcom.com>

 Date:  Wed, 10 Apr 2002 21:37:13 -0400
 To:  hwg-techniques(at)hwg.org,
Melanie Gann <mgann(at)second-street.com>
 References:  server
  todo: View Thread, Original
Just use SQL select statements with your favorite scripting language (JSP,
ASP, PHP, Perl..).

There are several ways to do this depending on the design of your Database.
Assuming a rationalized DB with tables  called product_family (and a field
called 'product'), a separate table for each family (e.g. a 'gizmo' table, a
'widget' table, a 'dodah' table..etc. ), and a table for 'parts', the calls
are:

SELECT DISTINCT product FROM product_family ORDER BY product ;

read the result recordset into a select box. The user selects 'Gizmo'

SELECT DISTINCT product_name FROM gizmo ;

read the result into a select box, the user selects 'Red Gizmo'

SELECT * FROM parts WHERE product='Red Gizmo'

read this recordset into a table.

heres a link to start you on databases and SQL
http://www.1keydata.com/sql/sql.html

Here's a webmonkey link on PHP
http://hotwired.lycos.com/webmonkey/programming/php/

Here's an ASP tutorial
http://www.w3schools.com/asp/asp_intro.asp

Here is Suns JSP pages.
http://java.sun.com/products/jsp/docs.html

I'm sure you can also do this in Coldfusion, but I have never believed in
paying for something that I can  do better for free!

HTH,

Frank
----- Original Message -----
From: "Melanie Gann" <mgann(at)second-street.com>
To: <hwg-techniques(at)hwg.org>
Sent: Wednesday, April 10, 2002 2:44 PM
Subject: ASP: Filtering Pulldown Select Lists


> I have a product hierarchy:
>
>          Product Family-+
>                         |
>                         Products--+
>                                   |
>                                   Parts
>
> The user selects the Product family, and I want to filter the next
> select list to products in that family. Likewise I want the parts
> select list to belong only to that product.
>
> Javascript allows you do to this nicely with arrays. However, I want to
> use data from the database.
>
> Any advice (or articles you can point me to) is appreciated.
>
> Regards,
> Melanie
>
>
>
> Second Street Web Design
> http://www.second-street.com
>
>

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.