I'm rendering a drop down box that contains a currently selected value using selected="true"
.
<select id="dropDown">
<option selected="true" value="1">value2</option>
<option value="2">value3</option>
<option value="3">value4</option>
</select>
Initially the selected value corresponds to the selected="true"
, but if I play around with the drop down box and then refresh the page the selected="true"
is ignored and the displayed value is the last one I chose. I tried using selected="selected"
with the same results.
Thanks for your help.
Solution 1: While hitting the refresh web button of the browser, hold the Shift key (or press Shift+F5). This must tell the browser to fetch the page from the server even if the page is already in the browser's cache.
To ensure you see the latest version of a site you need to clear the cache memory. This is done by doing a force refresh by pressing both control and F5 buttons simultaneously on your keyboard (depending on your browser). Most times a simple force cache refresh won't work and you need to clear the cache by hand.
Change your select field to <select id="dropDown" autocomplete="off">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With