I want the form to be reloaded and preselected with the selected selection. Here I have an HTML form:
<form name='vehicleform'>
<select name='vehiclelist'>
<option value=''>Select</option>
<option value='bus'>Bus</option>
<option value='bike'>Bike</option>
<option value='car'>Car</option>
</select>
<input type='text' name='current'></input>
</form>
When the user opens the page for the first time, the drop-down field will be Select by default , and the text field (current) will be empty.
When the user selects any option from the drop-down list, the page should be reloaded, and this drop-down element should be selected, and the value of this drop-down list should be in the text input field.
What JavaScript function do I need to make this happen?
source
share