Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I reset to default drop down list option on refresh(F5) in Firefox?

I have a ddl in firefox that does not get reset to the default caption. How do I do this? This is what I have so far.

<%string ddlVal = ""%>
<select id="detailSelect" name="DetailSelect">
    <option <%if (ddlVal == "") { Response.Write("selected = &quot;selected&quot;"); } %> value="" >--Choose One--</option>
    <option <%if (ddlVal == "Building") { Response.Write("selected = &quot;selected&quot;"); } %> value="Building">Building</option>
    <option <%if (ddlVal == "Contents") { Response.Write("selected = &quot;selected&quot;"); } %> value="Contents">Contents</option>
</select>

On a refresh, the ddl is the what is being displayed before the refresh, and not the default ddl. How do I corect this?

like image 765
MrM Avatar asked Oct 04 '10 19:10

MrM


1 Answers

add autocomplete="off" to the <select> tag. This is a known issue in firefox remembering your dropdown selection.

like image 109
nopuck4you Avatar answered Oct 26 '22 16:10

nopuck4you