Is it possible to disable Firefox\'s auto-fill feature without disabling auto-complete?
I know I can do this:
autocomplete=\"off\"
<
I had this problem myself. Mike's answer is close, but not perfect in my opinion: it empties elements, even if a value attribute may want to set it.
On pageload, I do the following. It uses only a little jQuery.
// Reset input elements to their HTML attributes (value, checked)
$("input").each(function(){
// match checkbox and radiobox checked state with the attribute
if((this.getAttribute('checked')==null) == this.checked)
this.checked = !this.checked;
// reset value for anything else
else this.value = this.getAttribute('value')||'';
});
// Select the option that is set by the HTML attribute (selected)
$("select").each(function(){
var opts = $("option",this), selected = 0;
for(var i=0; i
No jQuery?
Use document.getElementsByTagName to select the inputs and selects, then iterate over them and replace this by the iterated element.
Select the options with .getElementsByTagName('option').