Disable autofill in Chrome 63
Update Apr 2021:
Chrome and Firefox support autocomplete="off"
Safari continues to ignore autocomplete="off"
and as far as I know there's no good solution fore Safari except to obfuscate the field name.
Update Feb 2018:
Thanks to @JamesNisbet for pointing this out in the comments.
According to the Chrome team, autocomplete="off" and autocomplete="false" will be ignored moving forward. This is not a temporary regression in Chrome.
Chrome will attempt to autofill any form fields that follow the WHATWG standard on autocomplete. With one exception, they ignore "off" and "false" values.
In summary, to disable autofill, use the autocomplete attribute with a value that is not on the WHATWG list.
Make your case why you think autocomplete="off" should not be ignored by Chrome in this Chromium thread.
Looks like a possible regression in Chrome 63. In Chrome's original autofill documentation:
In the past, many developers would add autocomplete="off" to their form fields to prevent the browser from performing any kind of autocomplete functionality. While Chrome will still respect this tag for autocomplete data, it will not respect it for autofill data. So when should you use autocomplete="off"? One example is when you've implemented your own version of autocomplete for search.
https://developers.google.com/web/updates/2015/06/checkout-faster-with-autofill
They do make a distinction between autocomplete and autofill, although it's not clear they are different.
Chrome, Safari, and Edge are all attempting to implement autofill but there is no clear standard. They look at the name attribute rather than an explicit, standardized attribute.
For now autocomplete="something-new"
is a good workaround, although syntactically it makes no sense. This seems to work because the browser can't understand it.
Programmatically disabling Chrome auto-fill
jquery.disable-autofill
Disable Chrome's autofill. Handy for CRUD forms, when you don't want username/password inputs to be autofilled by the browser.
Usage:
<form>
<input type="input" name="username" autofill="off" autocomplete="off">
<input type="password" name="password" autofill="off" autocomplete="off">
</form>
<script src="jquery.disable-autofill.js"></script>
<script>
$('input[autofill="off"]').disableAutofill();
</script>
https://github.com/biesbjerg/jquery.disable-autofill
Disable Google Chrome Autocomplete / Autofill / Suggestion
Chrome no longer supports autocomplete="off"
. Use autocomplete="new-password"
instead.
Mozilla link
From the documentation:
For this reason, many modern browsers do not support
autocomplete="off"
for login fields:If a site sets
autocomplete="off"
for username and password input fields,
then the browser will still offer to remember this login, and if the
user agrees, the browser will autofill those fields the next time the
user visits the page. This is the behavior in Firefox (since version
38), Google Chrome (since 34), and Internet Explorer (since version
11).If an author would like to prevent the autofilling of password fields
in user management pages where a user can specify a new password for
someone other than themself,autocomplete="new-password"
should be
specified, though support for this has not been implemented in all
browsers yet.
Another solution is using autocomplete="false"
. Here are a few links to other SO questions that may help:
SO - Disabling Chrome Autofill
SO - Chrome Browser Ignoring AutoComplete=Off
SO - Chrome 63+ Autocomplete Bypass
Related Topics
How to Increase a Scrollbar's Width Using CSS
Make Bootstrap's Carousel Both Center and Responsive
Set Height 100% on Absolute Div
How to Create a Polygon Shape Div
Css3 Scale - Prevent from Scalling Text
CSS Custom Cursor Doesn't Work in Ff/Chrome
Pure CSS Chessboard with Div & No Classes or Ids, Is It Possible
Remove Blur Effect on Child Element
Fallback for CSS Attributes Without Unit
Center Image Element in Parent Div
What Are the Priorities Among CSS Selectors
Iframe with External Page Not Working
How to Nest Button Inside Another Button
All Widths Set to Width of Widest Element