Get ready for BLACK FRIDAY shopping starting in

Forums

PHP

This topic is locked

Dynamic dependent dropdown menu

Posted 24 Aug 2008 02:36:49
1
has voted
24 Aug 2008 02:36:49 Mike Scott posted:
Hey guys

I've had alot of success getting answeres here so i figured this would be the place to go. Ok on to my problem

I have 2 tables in my mySQL database.

one is called maincat and it has the following fields

ID
main_ID
MainCat

The other is called subcat and it has the following fields

ID
sub_ID
SubCat

What im trying to do is have the 2 drop downs on a form. the first drop down will populate with the records from "maincat" and then the second dropdown will populate with records from "subcat" that correspond to the maincat picked in the first drop down.

I've tried many tutorials to achieve this but every time i try them it never works correctly for me. I've even bought a DW extension to use, but of course that didn't even work. Im at a lost for what I'm doing wrong.

So if anybody has had this problem and was able to find a way of doing it and could give me some insight that would be great. Thanks in advance

Mike

Reply to this topic