Deos anybody know how to prevent the browser from keeping the last selected option when the client reloads the page?
The problem is that when I reload the page, it keeps the last selected option, and when I select the url in the address bar and hit Enter it will be reset.
I want the second result whicth means that I want to get the browser always reset the select box.
Please the simplest and the safest way :)
<option selected="selected"> won't work.
document.getElementById("selectBoxToBeReset").options[indexToBeSelected].selected = true;
and jquery helps even more:
$("#selectBoxToBeReset").selectOptions("value to be selected", true);
passing true as the second argument clears any previously selected value. Jquery select box tips.