Auto populate subcategory select box based on category choosen
| From: | David | Date: | Tue, 05 Dec 2000 18:20:08 +0000 |
| Subject: | Auto populate subcategory select box based on category choosen | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-28741@lists.php.net to get a copy of this message | ||
How do I populate 2nd select box that holds subcategories based on previous
select box which contains (categories). I need a simple example.
Example:
Select box 1 contains:
Select your OS:(categories)
Linux
Windows
Lets say user chooses Linux
Select Box 2 (autopopulates with subcategories for Linux loaded from
database: )
program 1 for Linux
program 2 for Linux
Select box 1 contains categories and select box two will populate with
subcategories based on the category choosen loaded from a MySQL database.
The data is stored in a single database called database1 using one table
that contains category and subcategory.
I know I have to use javascript but I need a very simple example on how to
do this.