I have 3 drop downs. One contains the category and the second contains months. Finally I have a third drop down that contains a combined list of each category followed by the months, it is structured like this:
Category 1
January
February
March
April
May
Category 2
January
February
March
April
May
Using jQuery, I would like the relevant option from the 3rd drop down to be selected depending on what criteria the user selects from the first two.
E.g. If they select Category2, then March. Then the March option listed underneath Category2 will be automatically selected from the 3rd drop down list.
I have prepared a fiddle that contains the basic drop down fields.
This is what the structure looks like:
<select>
<option value="category1">Category1</option>
<option value="category2">Category2</option>
</select>
<select>
<option value="january">January</option>
<option value="february">February</option>
<option value="march">March</option>
<option value="april">April</option>
<option value="may">May</option>
<option value="june">June</option>
<option value="july">July</option>
<option value="august">August</option>
<option value="september">September</option>
<option value="october">October</option>
<option value="november">November</option>
<option value="december">December</option>
</select>
<select>
<option>Category1</option>
<option>January</option>
<option>February</option>
<option>March</option>
<option>April</option>
<option>May</option>
<option>June</option>
<option>July</option>
<option>August</option>
<option>September</option>
<option>October</option>
<option>November</option>
<option>December</option>
<option>Category2</option>
<option>January</option>
<option>February</option>
<option>March</option>
<option>April</option>
<option>May</option>
<option>June</option>
<option>July</option>
<option>August</option>
<option>September</option>
<option>October</option>
<option>November</option>
<option>December</option>
</select>
I am not sure the best way to go about this.