Jonathon Bolster

web developer, programmer, geek

Enable autocomplete for all fields

This is part of my idea to just write a post for all the code snippets I have locked away in gists (especially bookmarklets)

Usually, to pass security requirements we need to disable autocomplete on all the form fields which can get annoying during development.

Here’s a small feature to re-enable autocomplete on all forms and input fields:

[].forEach.call(document.querySelectorAll('form,input'), function(e){ e.removeAttribute('autocomplete')})

And here’s it in link form for clicking and dragging to the bookmarks toolbar: Enable autocomplete

Elsewhere, I had something that would raise a warning about form fields not having autocomplete disabled (hint: it’s more or less the same as above).