Multiple dropdowns, combination check and filter
- by Tom
Using Javascript / jQuery, I'm trying to build a "combination checker" that will take the values of three (but can be more) dropdown lists and filter the options based on a supplied list of allowed combinations.
For example:
DROPDOWNS
Field 1:
- value_1
- value_2
Field 2:
- value_3
Field 3:
- value_4
- value_5
COMBINATIONS
- value_1, value_3, value_5
- value_1, value_3, value_4
- value_2, value_3, value_5
When a user selects Field 3 - value_4, the unavailable options will be disabled - ie, Field 1 - value_2 (there is no combination that allows value_2 and value_4 to be selected together).
It would be really great if someone could provide some pointers on how this can be achieved or just provide a fresh perspective - I'm going round in circles on this one!