I have a select item, that is filled with a list of files. This list of files is stored in a php variable.
I have another list of files, from another directory, stored in another variable.
I have a dropdown, with 2 options. When I change the dropdown, I want the items in the select to change to the file list associated with the item selected.
For example, my dropdown contains:
- Misc Images
- People
I have 2 variables, $misc
and $people
.
When Misc is selected, I want the select to contain all the images listed in $misc
, and when the People option is selected I want the select to contain all the options listed in $people
.
As far as looping through the php to generate all the items is fine, what I don't understand is how to do the javascript portion?
Thanks, and apologies for poor wording.