Jump to content

dynamic menus


darwin_tech

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.