I have 2 selects: month and year. When the user selects the year and the month then I want to redirect to the same page with a query string produced by the selections.
So this is what I have done:
<div id="custom-select1" class="custom-select" style="width:200px;">
<select name="month" onchange="if (this.value) window.location.href=this.value">
<option value="0">Select Month:</option>
<option value="?date_from={value-from-year-select}-01-01&date_to={value-from-year-select}-01-31&courses=on&events=on">January</option>
<option value="..">February</option>
<option value="..">March</option>
<option value="..">April</option>
<option value="..">May</option>
<option value="..">June</option>
<option value="..">July</option>
<option value="..">August</option>
<option value="..">September</option>
<option value="..">Octomber</option>
<option value="..">November</option>
<option value="..">December</option>
</select>
</div>
<div class="custom-select" style="width:200px;">
<select name="year" >
<option value="2000">Select Year:</option>
<option value="2018">2018</option>
<option value="2019">2019</option>
<option value="2020">2020</option>
<option value="2021">2021</option>
<option value="2022">2022</option>
<option value="2023">2023</option>
</select>
</div>
How I can replace {value-from-year-select} to get the value of the year selected?