Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.