Jump to content

Dynamic droplists off of a dropdown lists selection


Darkmatter5

Recommended Posts

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.

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.

 

 

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.