I page with a form to buy a t-shirt. There is a list of colors and a is used to display the list of the available size.
My problem is that the sizes will vary depending on which color is chosen. I'm looking for a way to change the content of the when one of the color is chosen.
Here's the form:
<a onclick="document.getElementById('productColor').value='2';" class="colorlink"><img src="BLACK.gif"></a>
<a onclick="document.getElementById('productColor').value='63';" class="colorlink"><img src="BLUE.gif"></a>
<a onclick="document.getElementById('productColor').value='66';" class="colorlink"><img src="GREEN.gif"></a>
<select id="size" name="size">
<option value="2" >SMALL</option>
<option selected value="3" >MEDIUM</option>
<option value="4" >LARGE</option>
<option value="5" >X-LARGE</option>
</select>
<input type="hidden" name="color" id="productColor" value="2"/>
Here's what i want to do:
- When the page is loaded, the box will display the default options above
- If BLUE color is clicked, then only Small and Medium options should be available.
- If GREEN color is clicked, then only Small, Medium and X-Large option should be available
- If BLACK color is clicked, all sizes should be available
Thanks for help !