mattquantic
Programmer
Hi. I am using a dropdown list to dynamically populate another dropdown lost from an array.
Very simple. It just loops trough the array, if the value of the selected element from the 1st dropdown matches a condition - an element is added to the second dropdown.
EG: Selecting a country from the first dropdown and having it's cities dynamically populated in the second.
I've done this loads and loads before and it works great.
However, at the moment I'm having to make it so that the first dropdown can have multiple selections.
So the script that loops through the array and populates the second dropdown can use and '=' condition as the value of the first dropdown could be '1,5,7' (rather than '1' or '5' or '7'.
For my loop how for I say:
if(secondvalue is in the list (1,5,7)){}
Please let me know if you know what I mean...
M@)
Very simple. It just loops trough the array, if the value of the selected element from the 1st dropdown matches a condition - an element is added to the second dropdown.
EG: Selecting a country from the first dropdown and having it's cities dynamically populated in the second.
I've done this loads and loads before and it works great.
However, at the moment I'm having to make it so that the first dropdown can have multiple selections.
So the script that loops through the array and populates the second dropdown can use and '=' condition as the value of the first dropdown could be '1,5,7' (rather than '1' or '5' or '7'.
For my loop how for I say:
if(secondvalue is in the list (1,5,7)){}
Please let me know if you know what I mean...
M@)