I have a small form with a list selected, and I submit the form every time I select an item. the problem is that after selecting a value and submitting the form, the selected item does not remain selected. Is there a way to save the selected item selected in the list after submitting the form? (e.g. using javascript)?
<form name="order_of_products_by_values" id="order_of_products_by_values" method="post" action="">
<select id="order_of_products_by_values" name="order_of_products_by_values" onChange="this.form.submit();">
<option value=1 >Pret crescator</option>
<option value=2 >Pret descrescator</option>
<option value=3 >Test</option>
<option value=4 >Test</option>
</select>
</form>
Thank you!
source
share