darwin_tech Posted March 28, 2011 Share Posted March 28, 2011 Hi there, I have a php project with a series of dynamically generated menus from a mysql database. I have two menus, Island Group and Island where the former should dictate the latter. When an option is selected in Island Group, I only want to populate the subsequent Island menu with islands in that group, without having to refresh the page. I am really not sure how to approach this, though I know that some javascript is required. If anyone can point me in the right direction it would be much appreciated. Regards, Sam Link to comment https://forums.phpfreaks.com/topic/231965-dynamic-menus/ Share on other sites More sharing options...
Adam Posted March 28, 2011 Share Posted March 28, 2011 How much data are we talking? If it's a small amount I'd store the islands in an array; the key being the value of the group. When the option is selected, just populate the islands select box using that array. If there's a large amount of data though I'd consider taking an AJAX approach, to dynamically load the islands as you select the group. Link to comment https://forums.phpfreaks.com/topic/231965-dynamic-menus/#findComment-1193379 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.