function radioCheck() {
document.getElementById("last").checked = "checked";
}
<label>
<input type="radio" name="Ppub" value="" checked="checked">All Dates
</label>
<br>
<label>
<input type="radio" id="last" name="Ppub" value=""> Last
</label>
<select name="Ppub" id="selectRange" value="" onchange="radioCheck();">
<option value="">Select</option>
<option value="20181220-20190120">month</option>
<option value="20180720-20190120">6 months</option>
<option value="20180120-20190120">year</option>
</select>
I am working on a search form and I have a group of radio buttons to filter the search. For one of the radio buttons, I want it to be "linked" to a drop down menu.
I am able to make the status of the radio button "checked" when the user selects an item from the menu. However, if the user checks another radio button, the value of the selected item is still used.
How do I group the radio button and drop down menu? I tried putting them in the same label but to no avail.
However, if the user checks another radio button, the value of the selected item is still used.
Can you elaborate on this? – AarononRadioChange
in that function first check what is value of radio and then decide what to do. – Kaushik