I have a form with a select drop down menu which calls on a javascript function that reloads the page with the parameters as a query string. I want to have the same dropdown option selected when the page is replaced. How should I go about doing this?
Select form:
<select name="fill_position" id="fill_position" onchange="reloadShowForm()">
JS:
function reloadShowForm() {
var fill_pos = $('#fill_position').val();
window.location.replace(window.location.href + "&fill_position=" + fill_pos);
}