Dynamic populating three drop down list based on the selected value of first two listBefore reading this please read the dynamic filling of second drop down list with selected value of first list. Here we will work with three drop down lists where the value of second list is populated based on the selection of first list and the values of third drop down list are populated based on the selection of second drop down list.
Using the same concept we can extend to add more dropdown list boxes.
self.location='dd3.php?cat=' + val + '&cat3=' + val2 ;
Here the page is reloaded on selection of second drop down list and for this the table structure is changed with creation of third table.
If you are facing any problem in using this code, please post it in php discussion forum with your error messages, bugs etc ..
view demo for three dropdown list here
|More tutorial on drop down list in PHP|
|i am using 3 dropdown menues, there are three table in my database,these tables are linked with foreign keys,but when i using just like your dd3.php, then 1st dropdown menu lost their value and get default value|
|Aji Mohan Singh||10-02-2014|
|I am looking for an easy php code|
|If I have more than 12 items in the subcategory2 table that link to one item in subcategory table, it will not list them all. Do you know why?|
|There is no reason why it should not list all 12 items ( if they are linked with category id ) |
|yeah its weird. i had to truncate the table and reenter the values then it started working.|
|how does this solution handle duplicate values. I want it to be able to display duplicates if possible.|