So, for example I have three select boxes.
<select name="cat-1" id="cat-1">
<option value="0">A</option>
<option value="1">B</option
</select>
<select name="cat-2" id="cat-2">
<option value="0">AA</option>
<option value="1">BB</option
</select>
<select name="cat-3" id="cat-3">
<option value="0">AAA</option>
<option value="1">BBB</option
</select>
<input type="submit" value="Add">
If I choose options, for example A BB AAA and press ADD, i want this combination to appear as text under add button as: A BB AAA (X)
x - to cancel such combination. I would like to add up to 3 combinations with ability to cancel any combination. After submitting form, I want to pass such combinations values in this case I guess array [0, 1, 0] would be fine. Options values cannot be submitted separately, because cat-2 and cat-3 are populated dynamically using ajax - cat-3 depends on cat-2 and cat-2 depends on cat-1 so many combinations are possible.
I am using select2 (http://select2.github.io/examples.html). It would be perfect If I could return combinations in style similar to 'Multiple select boxes' (see link above).
Any idea where do I start? I have no idea how to implement this the right way with ability in future, for example, on click on combination to set select boxes to combination values and etc.
I guess final input to database will be generated array of arrays like [[0,1,0], [0,0,0], [1,0,3], ...] in hidden field?