Why does the checkbox stay checked when reloading the page?

checkbox, firefox, html

Solution

Yes, I believe it is caching. I see this behaviour on Firefox for example (not Safari, for what that's worth :) ).

you can reload the page and bypass the cache (on Firefox) using CTRL-SHIFT-R and you'll see the check value doesn't carry (a normal CTRL-R will grab the info from the cache however)

edit: I was able to disable this server side on Firefox, setting a cache control header:

Cache-Control: no-store

this seems to disable the "remember form values" feature of Firefox

Problem

I'm reloading a web page that has the following code: ``` <label for="showimage">Show Image</label> <input id="showimage" name="showimage" type="checkbox" value="1" /> ``` Even though the HTML stays sent to the browser is the same for each reload of the page, the checkbox always takes on the checked value when a reload was performed. In other words, if the user checks the checkbox and reloads, the checkbox is still checked. Is there some caching going on here? Edit: I tried Gordon Bell's solution below and find that this is still happening even after removing the value="1". Anything else I might be missing? ``` <label for="showimage">Show Image</label> <input id="showimage" name="showimage" type="checkbox" /> ```

Original source