I just updated my browser to Chrome Version 63.0.3239.84 (Official Build) (64-bit).
I then proceeded to go on my website, where I have a input box with autocomplete='off'
, yet I still get the following:
(You can see my inbuilt suggestion dropdown below it)
This never used to be the case. Nothing else has changed!
Why is this happening? Is this a bug in the new version of chrome? I have tried all other suggestions like autocomplete="false"
or applying autocomplete=off to the form too. I have even tried to apply these with jquery after the page has loaded but also no luck.
I have tested this on multiple machines with the newest version of chrome on different operating systems. The issue persists.
Every answer I could find did not work for me. The most irritating part about my situation was how Android populated the
notes
field with a login name, resulting in erroneous notes being entered into the database.I thought about how typing into the text input clears the Android autofill and the below trick worked. Note that simply clearing the value did not remove the autocomplete, I had to set the field's value. Immediately clearing the value after setting a value also did not work. The delay is needed for Android chrome to see a change and remove the filled in value.
Bonus: doing this action on the
notes
field caused Android to empty the other autocompleted elements in my form.The function
setTimeout( callback, msec )
is javascript, thus a programmer could implement this without using jQuery.I usually do this to hide the autofill icon:
As Chrome will put the autofill icon on the first writable text field, the icon is placed on the hidden input field.
Note: Making the input field hidden-type or setting its display to 'none' doesn't seem to work.
autocomplete="off"
works in the current Chrome 68 as well as in Chrome 63.Demo.
Current working solution using JQuery:
Removed name and id from the input I don't want autofill on and added an identifying class. I then created a hidden input with the field name and id I want. Then on form submit I copy the value from the field with no id and no name (finding it by my identifying class), into the hidden field with the name and id.
HTML
Javascript
I reckon this should work as I don't see autofill latching on to anything other than an id or 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:
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.For Angular users, Since the
autocomplete = 'off'
ignore by new chrome versions, chrome developer suggestsautocomplete= 'false | random-string'
, so the google chrome/modern browsers have 2 type of users helpers -so what to do, in case of disabling both the annoying suggestions? Here is the trick:-
add
autocomplete = 'off'
in every input fields. (or simple Jquery).Remove the
<form name='form-name'>
tag from HTML code and addng-form = 'form-name'
in your<div>
container. addingng-form="form-name"
will also retain all your validations.