Forum Moderators: coopster

Message Too Old, No Replies

Form Drop down boxes

choose catagory 1 and have the matching sub catagories

         

gecko001

10:18 am on Jul 16, 2007 (gmt 0)

10+ Year Member



Hi guys,
has anyone managed to finesse this one.

I have a bunch of products i want to add to a database, i have a form to submit the products to the database.

What i need to crack is to have a drop down box for category 1 (beer or wine) and then automatically populate the drop down box for category 2 depending on the first selection

if cat1 = beer then cat2 options = Lager, Malt, Stout.
if cat2 = Stout then cat3 = Guiness, london, Old boot.
if cat3 = Guiness then cat4 = Bottle, Can.

I have four sub categories so need this to work on the fly before adding al info to the database.

If you can point me in the right direction i would appreciate it.
thanks Gecko

phparion

10:40 am on Jul 16, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



it will be done with ajax-php-mysql if you want to populate the subcategory drop down without refreshing the page.

otherwise use onChange event of the dropdown and call a page that populates the second dropdown based on the value selected in the first dropdown box however this will reload page on each selection of first dropdown

Habtom

11:01 am on Jul 16, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What i need to crack is to have a drop down box for category 1 (beer or wine) and then automatically populate the drop down box for category 2 depending on the first selection

. . . or just use js if your categories are fixed.

gecko001

9:57 pm on Jul 16, 2007 (gmt 0)

10+ Year Member



it will be done with ajax-php-mysql if you want to populate the subcategory drop down without refreshing the page.

can anyone point me in a direction to find out how to do this do this? ( categories are not fixed)

eelixduppy

11:29 pm on Jul 16, 2007 (gmt 0)

gecko001

8:30 am on Jul 18, 2007 (gmt 0)

10+ Year Member



Thank You!
Appreciate the pointer