EDIT Sept 2020: autocomplete="chrome-off"
disables Chrome autofill. Original answer below.
Original answer
For new Chrome versions you can just put autocomplete="new-password"
in your password field and that's it. I've checked it, works fine.
Got that tip from Chrome developer in this discussion:
https://bugs.chromium.org/p/chromium/issues/detail?id=370363#c7
P.S. Note that Chrome will attempt to infer autofill behavior from name, id and any text content it can get surrounding the field including labels and arbitrary text nodes. If there is a autocomplete token like street-address
in context, Chrome will autofill that as such. The heuristic can be quite confusing as it sometimes only trigger if there are additional fields in the form, or not if there are too few fields in the form. Also note that autocomplete="no"
will appear to work but autocomplete="off"
will not for historical reasons. autocomplete="no"
is you telling the browser that this field should be auto completed as a field called "no"
. If you generate unique random autocomplete
names you disable auto complete.
If your users have visited bad forms their autofill information may be corrupt. Having them manually go in and fix their autofill information in Chrome may be a necessary action from them to take.