I got following problem and dont know how to solve it. :(
I want to disable / gray out options in relation to a color-selection. Every option has a unique value.
For example:
- shirt (green) is only available in XS.
- shirt (blue) is available in S and M.
- shirt (yellow) is not available in L and XL.
Is it possible with something like "if" or an array function?!?! Is there a code snipped on fiddle?
Thanks for any help and sorry for my non-existing JS knowledge!
<form id="test" name="test" method="post" action="">
<label for="test"></label>
<select name="color" id="color">
<option value="1">---Select color---</option>
<option value="2">T-Shirt - green</option>
<option value="3">T-Shirt - blue</option>
<option value="4">T-Shirt - yellow</option>
</select>
<br />
<select name="size" id="size">
<option value="5">---Select size---</option>
<option value="6">XS</option>
<option value="7">S</option>
<option value="8">M</option>
<option value="9">L</option>
<option value="10">XL</option>
</select>
</form>