I'd like to change which checkboxes are checked based on which age is selected.
If adult is selected the first check box should be marked and the second unmarked. If 16-17 both should marked and if Under 15 only the second checkbox should be marked.
I suspect I need to use something other then on("click", but I'm not sure what the proper code is. There will be several other boxes to check/uncheck based on the selection but if I can get the right hooks I'm sure I can figure the rest out.
$('#age15').on("click", function() {
var ybox1 = $(input[name = "idparent"]);
ybox1.prop("checked", true);
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<label for="age">
<span class="<?=$braerr?>">Age </span>
<select id="age" name="age" value="" tabindex="">
<option value="">Choose Age</option>
<option id="age15" value="Under16" <?=($age=="Under16"?$sel:"");?>>Under 16</option>
<option id="age1617" value="16-17" <?=($age=="16-17"?$sel:"");?>>16-17</option>
<option id="ageadult" value="Adult" <?=($age=="Adult"?$sel:"");?>>Adult</option>
</select>
</label>
<input type="checkbox" id="dlid" name="dlid" value="dlid" <?if($hasdlid=="dlid")echo "checked=\"checked\"";?>>
<label for="dlid">Valid Driver's License, Learner's Permit, or State/Military ID</label>
<input type="checkbox" id="idparent" name="idparent" value="idparent" <?if($hasidparent=="idparent")echo "checked=\"checked\"";?>>
<label for="idparent">Copy of Parent's ID (Front and Back)</label>