Home » Questions » Computers [ Ask a new question ]

How do you disable browser autocomplete on web form field / input tags?

How do you disable browser autocomplete on web form field / input tags?

How do you disable autocomplete in the major browsers for a specific input (or form field)?

Asked by: Guest | Views: 328
Total answers/comments: 3
Guest [Entry]

"Firefox 30 ignores autocomplete=""off"" for passwords, opting to prompt the user instead whether the password should be stored on the client. Note the following commentary from May 5, 2014:

The password manager always prompts if it wants to save a password. Passwords are not saved without permission from the user.
We are the third browser to implement this change, after IE and Chrome.

According to the Mozilla Developer Network documentation, the Boolean form element attribute autocomplete prevents form data from being cached in older browsers.
<input type=""text"" name=""foo"" autocomplete=""off"" />"
Guest [Entry]

"In addition to setting autocomplete=off, you could also have your form field names be randomized by the code that generates the page, perhaps by adding some session-specific string to the end of the names.
When the form is submitted, you can strip that part off before processing them on the server-side. This would prevent the web browser from finding context for your field and also might help prevent XSRF attacks because an attacker wouldn't be able to guess the field names for a form submission."
Guest [Entry]

Most of the major browsers and password managers (correctly, IMHO) now ignore autocomplete=off.