I'm currently coding up two dropdowns that are dependent on each other. My first drop down is Stone Type and my second drop down is Stone Size. When I select a particular stone type, I only want to display the available stone sizes in the second dropdown. Here is an example:
User selects "Round" stone type, only want to display "6.5mm", "7.5mm", "8mm" in the stone size dropdown. User selects "Pear" stone type, only want to display "6.5mm", "8mm" in the stone size dropdown.
Here is my current HTML code:
<label>Stone Type</label>
<select name="centre-stone-cut" class="wpcf7-form-control wpcf7-select" aria-invalid="false">
<option value="">---</option>
<option value="Pear">Pear</option>
<option value="Round">Round</option>
<option value="Princess">Princess</option>
</select>
<select name="round-stone-size" class="wpcf7-form-control wpcf7-select" aria-invalid="false">
<option value="6.5mm - 1ct " price=" 478.40">6.5mm - 1ct </option>
<option value="7.5mm - 1.50ct " price=" 910.80">7.5mm - 1.50ct </option>
<option value="8mm - 2ct " price=" 1131.60">8mm - 2ct </option>
</select>
I'm trying to achieve this using Javascript, and I've seen a few ways online but nothing that could really work for mine. If anyone could help me out, that would be greatly appreciated.