When trying to change the value of the first dropdown list and reset the second dropdown before submission, I encountered an issue where the second dropdown still retains its previous selection upon submission. There is no submit button as the form is submitted on change in the dropdown menu. Here is the code snippet:
function reset() {
$('#second').val("");
}
<!-- First Dropdown -->
<select class="form-select mb-3" id="first" name="first" onsubmit="this.form.reset();" onchange="this.form.submit()">
<option value="1" >Hello</option>
<option value="2" >World</option>
</select>
<!-- Second Dropdown -->
<select class="form-select mb-3" id="second" name="second" onchange="this.form.submit()">
<option value="1" >Hello</option>
<option value="2" >World</option>
</select>
Looking for suggestions or ideas to resolve this issue.