Laser said:
Does anyone know of a way to stop a browser from remembering checkbox
selections when you refresh the page? Either by JS Code or HTML.
You could use the nonstandard attribute autocomplete="off" in the <input>
tag, but it's something undocumented and unreliable; specifically, it does
the job on Firefox 3.5 but not on IE 8, for example. And perhaps mostly by
accident, as a side effect of the way it was implemented in some browsers;
its design goal was to affect autofilling of text input boxes.
Using JavaScript, you could reset the form when the page is loaded (and
refresh is counted as a load):
<body onload="document.getElementById('yourform').reset()">
where 'yourform' is the id of your form (<form id="yourform" ...>).
This implies that when a user accidentally hits Reload after spending half
an our in entering his huge product order that would make you earn a lot, he
wipes away all of the input, unrecoverably, as if he had hit the infamous
destruction button (commonly mislabeled as "Reset" or "Clear").
So if you wish to do something less risky, you might use code that just
clears a particular checkbox, for example, e.g.
<body onload="document.getElementById('foobar').checked = false">
where 'foobar' is the id of your checkbox (<input type="checkbox"
id="foobar" ...>).