I have something like this:
<select class="bla">
<option value="1">...</option>
<option value="2">...</option>
</select>
<select class="bla">
<option value="1">...</option>
<option value="2">...</option>
</select>
<select class="bla">
<option value="1">...</option>
<option value="2">...</option>
</select>
<input class="alloptions" type="hidden" value="">
I want the hidden input field value to change every time a different option is selected in each of the select input fields above.
This value would contain the selected options from all input fields separated with commas.
How can I do this?
Something like:
Explanation:
change()gets fired whenever the value of a select field changesmap()we create an array of the values of theselectfields andjointhem to a string separated by commas