Twitter: raymondcamden


Address: Lafayette, LA, USA

Sunday Quickie - Bookmarklet to "Fix" forms that disable autocomplete

03-23-2014 3,050 views Misc

I don't know about you, but when I see a form that has disabled autocomplete, I get pretty upset:

I understand the logic behind doing so on certain secure forms, but when I ran into this a few minutes ago for a freaking survey I wanted to punch my screen. (Ok, maybe I need to take a deep breath and relax too. ;)

For the heck of it, I wrote a quick bookmarklet to fix this problem. A bookmarklet is simply a set of JavaScript code in a bookmark. I've added this bookmark to my main toolbar so it is one click away. Just add the following:

javascript:forms = document.querySelectorAll("form");for(var i=0;i<forms.length;i++) { forms[i].removeAttribute("autocomplete"); }

I'm sure this could be written better (maybe instead of always removing the attribute it could always enable it), but on my limited testing (the form that ticked me off) it worked perfectly.