How to retain the selected values in the drop down on submit
posted 5 years ago
I have a JSP page with two drop downs. i select values from them and click the submit button. on submit my page loads back with the google map plotting some points. that is working fine. However i want the drop downs to retain the values that have been selected on the result page as well.. how do i do that?
You must be getting that selected value on the result page after the submission.
Just change the <option>Your_Previously_selected_Value</option> to <option selected="selected">Your_Previously_selected_Value</option>.
If you are using <option>val</option> in a loop then you have to place a check.