Darkmatter5 Posted December 2, 2008 Share Posted December 2, 2008 Can anyone direct me to a tutorial or something on how to create multiple dropdown lists and dynamically populate based off of what is selected in the others? Link to comment https://forums.phpfreaks.com/topic/135159-dynamic-droplists-off-of-a-dropdown-lists-selection/ Share on other sites More sharing options...
waynew Posted December 2, 2008 Share Posted December 2, 2008 That's javascript. http://www.felgall.com/jstip22.htm Link to comment https://forums.phpfreaks.com/topic/135159-dynamic-droplists-off-of-a-dropdown-lists-selection/#findComment-703928 Share on other sites More sharing options...
Darkmatter5 Posted December 3, 2008 Author Share Posted December 3, 2008 That's a good beginning, but that tutorial has pre defined selection options based on what's selected in the first list. I have 3 dropdown lists: Cabinets Folders Items If you change a selection in Cabinets, Folders changes to the Folders that are within that specific Cabinet and then if a selection is made in Folders then Items changes to list the Items within that specific Folder. I can see the use of that tutorial, but according to the tutorial the new selections in the Folders and Items dropdown lists have to be created within the Javascript and as far as I know that's impossible as Javascript is client side and PHP is server side. Link to comment https://forums.phpfreaks.com/topic/135159-dynamic-droplists-off-of-a-dropdown-lists-selection/#findComment-704963 Share on other sites More sharing options...
Brian W Posted December 3, 2008 Share Posted December 3, 2008 Your looking at needing Ajax my friend. You could find out how to do that yourself or you could pay one of the code monkeys around here to do it but It is in your favor to learn how it is done. Here is a brief overview of how I would do it (which may not be the best way...) Create three divs with id's "Cabinet", "Folder", "Item". Create two other php pages that only contain a dynamically created menu based on a $_GET value. :::This would likely be a unique ID passed from the above level::: Use java script to trigger pulling in your "Folder" page into the div "Folder" with a URL variable to pass the "Cabinet" ID or whatnot. Same thing for the "Folder" level to the "Item" level. Link to comment https://forums.phpfreaks.com/topic/135159-dynamic-droplists-off-of-a-dropdown-lists-selection/#findComment-704977 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.