Disabling Chrome Autofill
Solution 1
Jan 2021: autocomplete="off"
does work as expected now (tested on Chrome 88 macOS).
For this to work be sure to have your input tag within a Form tag
Sept 2020: autocomplete="chrome-off"
disables Chrome autofill.
Original answer, 2015:
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.
Solution 2
I've just found that if you have a remembered username and password for a site, the current version of Chrome will autofill your username/email address into the field before any type=password
field. It does not care what the field is called - just assumes the field before password is going to be your username.
Old Solution
Just use <form autocomplete="off">
and it prevents the password prefilling as well as any kind of heuristic filling of fields based on assumptions a browser may make (which are often wrong). As opposed to using <input autocomplete="off">
which seems to be pretty much ignored by the password autofill (in Chrome that is, Firefox does obey it).
Updated Solution
Chrome now ignores <form autocomplete="off">
. Therefore my original workaround (which I had deleted) is now all the rage.
Simply create a couple of fields and make them hidden with "display:none". Example:
<!-- fake fields are a workaround for chrome autofill getting the wrong fields -->
<input style="display: none" type="text" name="fakeusernameremembered" />
<input style="display: none" type="password" name="fakepasswordremembered" />
Then put your real fields underneath.
Remember to add the comment or other people on your team will wonder what you are doing!
Update March 2016
Just tested with latest Chrome - all good. This is a fairly old answer now but I want to just mention that our team has been using it for years now on dozens of projects. It still works great despite a few comments below. There are no problems with accessibility because the fields are display:none
meaning they don't get focus. As I mentioned you need to put them before your real fields.
If you are using javascript to modify your form, there is an extra trick you will need. Show the fake fields while you are manipulating the form and then hide them again a millisecond later.
Example code using jQuery (assuming you give your fake fields a class):
$(".fake-autofill-fields").show();
// some DOM manipulation/ajax here
window.setTimeout(function () {
$(".fake-autofill-fields").hide();
}, 1);
Update July 2018
My solution no longer works so well since Chrome's anti-usability experts have been hard at work. But they've thrown us a bone in the form of:
<input type="password" name="whatever" autocomplete="new-password" />
This works and mostly solves the problem.
However, it does not work when you don't have a password field but only an email address. That can also be difficult to get it to stop going yellow and prefilling. The fake fields solution can be used to fix this.
In fact you sometimes need to drop in two lots of fake fields, and try them in different places. For example, I already had fake fields at the beginning of my form, but Chrome recently started prefilling my 'Email' field again - so then I doubled down and put in more fake fields just before the 'Email' field, and that fixed it. Removing either the first or second lot of the fields reverts to incorrect overzealous autofill.
Update Mar 2020
It is not clear if and when this solution still works. It appears to still work sometimes but not all the time.
In the comments below you will find a few hints. One just added by @anilyeni may be worth some more investigation:
As I noticed, autocomplete="off"
works on Chrome 80, if there are fewer than three elements in <form>
. I don't know what is the logic or where the related documentation about it.
Also this one from @dubrox may be relevant, although I have not tested it:
thanks a lot for the trick, but please update the answer, as display:none;
doesn't work anymore, but position: fixed;top:-100px;left:-100px; width:5px;
does :)
Update APRIL 2020
Special value for chrome for this attribute is doing the job: (tested on input - but not by me)
autocomplete="chrome-off"
Solution 3
After months and months of struggle, I have found that the solution is a lot simpler than you could imagine:
Instead of autocomplete="off"
use autocomplete="false"
;)
As simple as that, and it works like a charm in Google Chrome as well!
August 2019 update (credit to @JonEdiger in comments)
Note: lots of info online says the browsers now treat autocomplete='false' to be the same as autocomplete='off'. At least as of right this minute, it is preventing autocomplete for those three browsers.
Set it at form level and then for the inputs you want it off, set to some non-valid value like 'none':
<form autocomplete="off">
<input type="text" id="lastName" autocomplete="none"/>
<input type="text" id="firstName" autocomplete="none"/>
</form>
Solution 4
Sometimes even autocomplete=off
won't prevent filling in credentials into wrong fields.
A workaround is to disable browser autofill using readonly-mode and set writable on focus:
<input type="password" readonly onfocus="this.removeAttribute('readonly');"/>
The focus
event occurs at mouse clicks and tabbing through fields.
Update:
Mobile Safari sets cursor in the field, but does not show virtual keyboard. This new workaround works like before, but handles virtual keyboard:
<input id="email" readonly type="email" onfocus="if (this.hasAttribute('readonly')) {
this.removeAttribute('readonly');
// fix for mobile safari to show virtual keyboard
this.blur(); this.focus(); }" />
Live Demo https://jsfiddle.net/danielsuess/n0scguv6/
// UpdateEnd
Explanation: Browser auto fills credentials to wrong text field?
filling the inputs incorrectly, for example filling the phone input with an email address
Sometimes I notice this strange behavior on Chrome and Safari, when there are password fields in the same form. I guess, the browser looks for a password field to insert your saved credentials. Then it autofills username into the nearest textlike-input field , that appears prior the password field in DOM (just guessing due to observation). As the browser is the last instance and you can not control it,
This readonly-fix above worked for me.
Solution 5
If you are implementing a search box feature, try setting the type
attribute to search
as follows:
<input type="search" autocomplete="off" />
This is working for me on Chrome v48 and appears to be legitimate markup:
templaedhel
Updated on July 17, 2022Comments
-
templaedhel almost 2 years
I have been running into issues with the chrome autofill behavior on several forms.
The fields in the form all have very common and accurate names, such as "email", "name", or "password", and they also have
autocomplete="off"
set.The autocomplete flag has successfully disabled the autocomplete behavior, where a dropdown of values appear as you start typing, but has not changed the values that Chrome auto-populates the fields as.
This behavior would be ok except that chrome is filling the inputs incorrectly, for example filling the phone input with an email address. Customers have complained about this, so it's verified to be happening in multiple cases, and not as some some sort of result to something that I've done locally on my machine.
The only current solution I can think of is to dynamically generate custom input names and then extract the values on the backend, but this seems like a pretty hacky way around this issue. Are there any tags or quirks that change the autofill behavior that could be used to fix this?
-
Nicu Surdu about 11 yearsFor the workaround solution: wouldn't this make the password field autofilled nevertheless ? And thank you for the edit solution. I would leave only that as an answer.
-
mike nelson about 11 yearsGood point, removed that workaround and now just has the solution.
-
lucasarruda over 10 yearsThanks for sharing this info. Was having this very same weird behavior and wasn't understanding why it happens until you clarify. On my case, it only happened when I turned autocomplete="on". That was why I wasn't experiencing this issue before.
-
goodeye over 10 yearsExcellent answer for the reason. For the solution, I'm trying this, as well as stackoverflow.com/q/10938891/292060. I'd prefer to turn off autofill, but keep autocomplete.
-
parliament about 10 yearsI was so sure this would work as you explained perfectly the heuristic autofill I'm experiencing with input before password field. Unfortunately, it didn't work for me, I put autocomplete="off" on both the form and all the inputs and they still get filled. The only solution that worked for me is in goodeye's link above. (placing a second hidden type="password" input before the password throws off chrome's heuristic checks)
-
Ham Za about 10 yearsThis used to work fine, I used it too, but since a Chrome upgrade some time ago (between then and May 5th), Chrome ignores the form property :(
-
Ham Za about 10 yearsThis doesn't work well for me: chrome still autofills the password field visibly, while the username is indeed hidden.
-
Jobin about 10 yearsyes its not for password its for user name if you need password too try to create a password fake field too.check my edit
-
Jammer almost 10 yearsGoogle took the decision in (Chrome v34 I think) to make it policy to ALWAYS now ignore autocomplete="off", including form level directives ... that would be fine if it actually got the damn fields right.
-
mike nelson almost 10 yearsThanks for the comments, I've tried it again myself also and agree my old solution no longer works, so have updated with the latest solution.
-
carbontwelve almost 10 yearsIt is incredibly annoying that google decided to make chrome ignore the autocomplete attribute - it kept autofilling a user record edit form with the admins login details until I found your work around. Thanks.
-
Jeffrey Simon almost 10 yearsThis one worked for me (for now). I have found that I have used about a half dozen different hacks over time, and after a while Chrome decides it wants to defeat that hack. So a new one is needed, such as this one. In my application, I have a profile update form with email and password fields that are to be left blank unless the user wants to make changes. But when Chrome autofills, it puts the userid in the "email confirmation" field, resulting in all kinds of error conditions, that lead to further error conditions, as the user flounders about trying to do the right thing.
-
Mark42 almost 10 yearsThe solution does indeed work but it's ridiculous that such a kludge is even necessary. When a dev codes autocomplete=off into a form, it's usually for a good reason. No means no, Chrome! Discussion of the issue: code.google.com/p/chromium/issues/detail?id=352347
-
Patrick Cullen over 9 yearsyou can remove the name attributes so these fake params aren't posted to server
-
MrBoJangles over 9 yearsA quick explanation as to why this hack works (for now): Chrome sees the first type=password input and autofills it and it assumes that the field directly before this MUST be the userhame field, and autofills that field with the username. @JeffreySimon this should explain the phenomenon of userid in email confirmation field (I was seeing the same thing on my form).
-
Jeffrey Simon over 9 yearsI suspect it won't be long before Chrome figures out how to defeat this hack. Why does Chrome try to hard to prevent a function that should be up to the developer?
-
qmo over 9 yearsThanks for the workaround. I had to change a bit by putting the fake username before the real one and fake password after the the real one.
-
mike nelson over 9 years@qmo - why did you have to do that? It usually works fine having both fake user and fake password before the real ones.
-
qmo over 9 years@mikenelson It didn't work for me, Chrome picked up the fake username + the real password. Btw, I'm using Chrome 39.
-
Roey over 9 yearswhat a great fix :) you should replace jquery with this: this.removeAttribute("class")
-
mistertodd over 9 years@Mark42 The reason all browsers had to start ignoring it is because developers would put it there without good reason. E.g. Managers, lawyers, legal department, HIPAA, and Sarbanes–Oxley are not valid reasons to disable autocomplete. But that didn't stop developers from bowing to pressure from the U.S. government. The better way to not auto-complete passwords is to tell Chrome to not remember your password.
-
praniclift about 9 yearsEven better: remove the
name=""
attributes on both inputs and that information never even gets posted to your server, but it still fools Chrome. -
ComfortablyNumb about 9 yearsI used this to stop a dropdwonlist from being autofilled. But also restyled readonly so it didn't look it. Cool idea!
-
kentcdodds about 9 yearsThis is the only solution that actually works. I really don't like it, but that's the crummy state we're in right now :-(
-
kentcdodds about 9 yearsUnfortunately, this applies to more than just username/password type things. Chrome will look at the placeholder text to infer what to suggest. For example: jsbin.com/jacizu/2/edit
-
kentcdodds about 9 yearsUnfortunately, this no longer works :-( jsbin.com/sobise/edit?html,css,output
-
Bernesto about 9 yearsIt is valid that you will still be able to fill the fields with browser suggestions as your example demonstrates, so this doesn't really address the OPs issue. This solution, just prevents the browser from "automatically" populating username and passwords combos as in the example by the top answer. This may be of use to some, but is not an end-all solution to just disabling autocomplete, that will have to come from Google.
-
Bernesto about 9 yearsAlthough, if you add a space in front of your placeholder text it will disable the auto-suggest based on placeholder too. Definitely a hack, although no more so than the other suggestions. jsbin.com/pujasu/1/edit
-
kentcdodds about 9 yearsactually... it seemed to work for your example, but for some reason it's not working for me :-(
-
dsuess about 9 years@kentcdodds: Chrome update: Google released Chrome v41 on March 19th, but I can not find any specific note in their change log. Please specify your comment: The initial question was, how to prevent Chrome from filling saved values to wrong field names. How does your example code behave? In your example I notice 3x text-input fields, without
name
attribute and no surroundingform
tag. -
Bernesto about 9 yearsHa! That's why it's called a hack... Do you have an example you can share where it's not working?
-
mike nelson about 9 years@kentcdodds - not sure what you mean about no longer working. Your jsbin does not have a password field so is a different situation. I've been using this solution for years and most recently I noticed it was needed and it worked for me just last week (March 2015).
-
M. Eriksson about 9 yearsYes it does. I just used the above solution. And your jsbin works as well. Chrome 41. :)
-
Yesudass Moses about 9 yearsThis will become a big security issue ?? If the user mistakenly click the "save password", and he doesn't view any passwords on the login textboxes. He will think that there's no password saved. but its still saved, and recoverable by Javascript :/
-
ng-darren about 9 yearsHi guys, this solution doesn't work. Tried on both Chrome 41 and 42. So I twisted the hack by inserting invisible spans into the label instead. It worked beautifully on Chrome 41 and 42. - <label for="address">Registered Add<span style="display:none">This is to make Chrome to not autocomplete</span>ress: </label>
-
roughcoder about 9 yearstry autocomplete="false" not autocomplete="off"
-
Fery Kaszoni about 9 yearsIt does work very well Aaron, in all major browsers ;)
-
Clint about 9 yearsIn Chrome, the readonly attribute trumps the required attribute on an input which breaks client side validation.
-
dsuess about 9 years@Clint: My code snippet above removes the readonly attribute as soon as the user enters the field (per mouse click or tab key). I guess, you refer to a field, which is auto fill protected, but not touched by the user. What is this field purpose - and does it really need to be protected? Depending on the scenario, removing all readonly attributes on submit may be an option. Can you add a more specific comment on your issue? Maybe I can help you out :)
-
Dvd Franco almost 9 yearsWorked for me! But there is one important remark: I have 5 fields in my web page: Name, Address, Zip code, Phone and Email. When I included autocomplete='false' on the Form and on the Name field, it still worked. However, when I included the autocomplete='false' also on the Address field, it finnally stopped autofilling them! So, you need to put the autocomplete property not on the login or name field, but on the following fields too! (Worked on Chrome 43.0.2357.81 as of 2015-05-27)
-
genkilabs almost 9 yearsIF THIS DOES NOT WORK FOR YOU: Keep in mind that there are 2 ways Chrome "helps" users. AUTOCOMPLETE will prompt based on previous submission in the same form filed and will affect people who are using the form more than once. Autocomplete is disabled with autocomplete="off". AUTOFILL will prompt based on the address book from previously filled out similar forms on other pages. It will also highlight the fields it is changing. Autofill can be disabled with autocomplete="false".
-
Loenix almost 9 yearsThis is not an elegant solution, using bootstrap the field is styled as a readonly input but this is not one.
-
dsuess almost 9 years@Loenix: your sample is about a different answer and uses autocomplete="off", while my solution is about the readonly attribute. Btw. I guess there is a little typo in the fiddle you listet. The event listener
$(this).one("focus...
should likely be$(this).on("focus...
. Kind regards, dsuess -
Loenix almost 9 years@dsuess This script apply the readonly solution on a field with autocomplete="off". It uses one jQuery method to apply event only one time, because after the first focus event, the readonly attribute is already removed (here i respect jQuery standards, we should edit the property and not the attribute). api.jquery.com/one
-
Walid Ammar almost 9 yearsIt worked with little modification,
$timeout(function() { element.val("") }, 300)
-
rybo111 almost 9 yearsThis doesn't work for me (Version 43.0.2357.124 m). This was probably an oversight by Google, which has now been resolved. They seem to be thinking "the user is always right" in that they want to autofill everything. The problem is, my registration form saves the user data just like the login form does, which is most definitely not what the user wants...
-
rybo111 almost 9 yearsThis attribute is also required:
autocomplete="I told you I wanted this off, Google. But you would not listen."
-
rybo111 almost 9 yearsHooray! A solution that seems to work! I would advise giving the field the name
password
and havingactual_password
for the legitimate field, as Google now seem to be looking at thename
. However, this means Chrome won't then save the password, which is the functionality I actually want. AAAAARRRRGHH! -
rybo111 almost 9 yearsIf you're using JavaScript. why not just set the value to
dummy
and then remove the value again? Adding and removing readonly sounds like a hazardous move - what if the browser doesn't want you to focus on it? -
cyberskunk almost 9 yearsIt worked for me even without name attribute. But I had to add non-empty value attributes to prevent FF (38.0.5) from autocompleting these hidden inputs.
-
rybo111 almost 9 years@Vaia - have you tried navigating to another page and then pressing the back button? I get mixed results - it may need tweaking.
-
AlexioVay almost 9 yearsI haven't tried option 1 if you mean that. Also I just needed to disable the autofill on an ajax-loaded modal that won't be called with the back button. But if there will be other results, I'll tell you. @rybo111
-
rybo111 almost 9 years@Vaia I meant option 2 - please reply here if you encounter any problems. Thanks.
-
Adriano Rosa almost 9 yearsYEP It works in Chrome 43.0.2357!! this behaviour in Chrome is so annoying, and this workaround took me a while to figure out. Thanks for your answer.
-
DestyNova almost 9 yearsIt might not work on old browsers, base on a old 2005 post from Scott Hanselman's blog: hanselman.com/blog/…
-
Jim G. almost 9 years@MagnusEriksson: No. The jsbin does not work. Chrome 43.0.2357.134
-
Kevin almost 9 years'new-password' worked for me after trying 'off' and 'false'
-
Noel Abrahams almost 9 yearsI would not recommend this solution. Setting autocomplete to "false" works in Chrome but FireFox ignores it.
-
Fery Kaszoni almost 9 yearsNoel Abrahams, the question here was about Chrome and not about Firefox!
-
Anas almost 9 yearsWorked on Chrome V 44, see documentation here: developers.google.com/web/fundamentals/input/form/…
-
David almost 9 yearsThis is the only working fix now. False, and off, do not work anymore. Should be the correct answer now.
-
Rob Scott almost 9 yearsWorks for Version 44.0.2403.130 m - only thing that worked for me!
-
Mattijs over 8 yearsdoesnt work with Chrome 44.0.2403.157. How can this feature work and not work with different versions. It is ridiculous
-
Mattijs over 8 yearsYes, I can confirm that next to the 2 fake fields, you need autocomplete="off" in your form element. This is hilarious :)
-
John Little over 8 yearsThis does not work for me, chrome still auto fills lastname and password for new accounts. chrome is ignoring autocomplete attribute.
-
MrBoJangles over 8 yearsThis solution briefly worked, I guess. Not so much anymore. At least, not in our angular site.
-
MrBoJangles over 8 yearsUpdate: This continues to work over a year since the last time I implemented it. We may have a solid winner here.
-
J.T. Taylor over 8 yearsSee my answer here for a reliable workaround: stackoverflow.com/questions/12374442/…
-
artdias90 over 8 years@roughcoder what autocomplete=false did not make it work. Its the same as autocomplete=off, chrome doesnt care
-
The Muffin Man over 8 years@GrahamT Might want to check your code, I just updated to 46.0.2490.80 m and it works.
-
H. Ferrence over 8 yearsThis poses a huge and serious security exposure. Any site can harvest usernames and passwords, ip addresses from the client, and a host of other _SERVER variable info. I just proved it on my site by looking at the _POST vars submitted. And I thought Google was smart. Fooled me.
-
dlsso over 8 years@Toolkit Works for me on Chrome 46.0.2490.80. I think it's something other than browser version that's the problem.
-
Toolkit over 8 yearswow Chrome, you surprise me, is there some bug submitted or whatever?
-
Joe Heyming over 8 yearsIt's not really the fact that you say PreventChromeAutocomplete. I was able to get autocomplete to work by saying autocomplete="off" and name="somename". But this only works if you name two different inputs the same name. So in your case PreventChromeAutocomplete must have been applied to two different inputs. Very strange...
-
Olivier Pons over 8 yearsThis is both the most effective way but the worse hackish way. It's how the web works: not good job, clean job. No. Hacks, hacks, hacks, hacks, hacks, hacks, hacks, hacks. I'm fed up with that.
-
Theo Orphanos over 8 yearsI tried autocomplete="false" and didn't work on Chrome 47.0.2526.106... However when I use: autocomplete="off" in the "form" tag as well as in every "input" tag that works great!
-
www139 over 8 yearsIt worked for me but you have to assign it to a specific input element. It will not work if you apply this to the
<form>
element. -
Victor F over 8 yearsIt looks like this just stopped working in Chrome v48.0.2564.82 m
-
Tom Rossi over 8 yearsI tried all the previously mentioned fixes and none worked for me on Version 47.0.2526.111 (64-bit)
-
Adam Jimenez over 8 yearsYes it stopped working - it's like an arms race. I solved it with: <div style="height:0; overflow: hidden;"> <input type="text" name="fakeusernameremembered"> <input type="password" name="fakepasswordremembered"> </div>
-
Victor F over 8 years@AdamJimenez, the problem with your solution is that a person can Tab into the invisible field, which is not a good thing. I got it working with solution by hyper_st8 below.
-
Adam Jimenez over 8 years@VictorF Ahh, thanks for the heads up I will use that also. It's like an arms race!
-
Stijn Geukens over 8 years@mikenelson: any idea why the solution (fakeusernameremembered) works?
-
scebotari66 over 8 yearsthis doesn't work in the latest Chrome (48.0.2564.109). when the fake input is visible, it captures the autofill, but when it's hidden via display none - it doesn't. I tried to absolutely position the fake input and give it 0 width and height, also doesn't work. The only way I managed to make it work is with height of 1px.
-
Jacka over 8 yearsstrange fix but somehow that's the only thing that works for me on chrome 48 :)
-
David about 8 yearsThis actually killed the entire form autofill options not just the field for me.
-
Liorsion about 8 yearsSmall comment: I've noticed it only works if the fields were AFTER my real fields (ie Chrome was taking the last field to autofill)
-
epelc about 8 yearsThank you! This is the only thing that works in chrome 49. Previous methods broke as chrome seems to fill all inputs with
type="password"
now. -
ymerej about 8 years@Liorsion So that worked for me, until I updated to v49 today. It seems like they reverted back to only working if you put it before the real fields. Can't seem to win. Not sure what is up with their developers constantly f'ing with this. People complain about IE, but man, they are making themselves look just as bad. Anyway I've now added these fake fields to before and after the real fields
-
Admin about 8 yearsGreat work, how did you find out the algorithm of Chrome? I just found out that my old method changing the value with JS after the page has been loaded with a setTimeout timer doesn't work anymore. But this works perfect!
-
Liam about 8 yearsGreat this is the only one that worked on v49 for me Thanks
-
Colin Wiseman about 8 yearsThis appears to be broken now on version Version 49.0.2623.110 m. Testing: cleared all passwords for the domain, logged in on one form and saved the password, went back to my create account form and the fields were filled in and the hidden fields were still there. Chrome is painful!
-
eYe about 8 yearsUnfortunately, does not work for regular TextBox inputs.
-
Fareed Alnamrouti about 8 yearsactually it is working just set the name property ;)
-
Tauras about 8 yearsUpdated my chrome, and still it does work for me. 50.0.2661.87 (64bit)
-
agarcian about 8 yearsThis is something that actually worked for me after other attempts. I am using Chrome 50.
-
MrFabio about 8 yearsWorks 100%. Simple and effective. Thank you so much, tested on 50.0.2661.94 m
-
Urs about 8 years
<form autocomplete="off">
worked for me in Chrome 50something -
Ixalmida about 8 yearsThis worked for me, but only after I named the fields the same as the existing fields (name="email" / name="password"). It made no difference where the fake fields are in the form (I placed them at the top). Input type also doesn't seem to matter (works with no type tag). My Chrome version is 50.0.2661.102 m.
-
rybo111 almost 8 yearsI concur with @Ixalmida - there have been changes to Chrome and the
style="display:none"
trick now only works if you use the correct input name (e.g.name="email"
). You don't need a password field, it seems. -
sibbl almost 8 yearsUnfortunately, when submitting the form (or when the input fields are hidden/removed), Chrome then asks to save the changed login.
-
sibbl almost 8 yearsUnfortunately Chrome then asks the user to save the changed password when the form is submitted/hidden.
-
Jack almost 8 yearsIf I add the two hidden fields above, Chrome fills it in and then carries on and fills all the rest in as well! Wtf Chrome
-
Geoffrey Hale almost 8 yearsWorks in Version 51.0.2704.79 m
-
Geoffrey Hale almost 8 yearsWorks in Version 51.0.2704.79 m
-
Geoffrey Hale almost 8 yearsThis does not work. Use
autocomplete="new-password"
(stackoverflow.com/a/30976223/1438029). Verified works in Version 51.0.2704.79 m. -
Joe RR almost 8 yearsholy f*** why this works? is that a bug? because i tested it here and place it only in one input and worked for both input login and password, but i put it only in the password
-
Tauras almost 8 yearsI have no idea. I think thats a chrome "thing" which was made by developers. Maybe i am mistaken.
-
Denis almost 8 yearsAs for June of 2016 and Chrome 51.0.2704.106 m this is the only working solution over here
-
AlexioVay almost 8 yearsBut will the form select the right (visible) input field you need then? Because it's the same name.
-
dlsso almost 8 yearsNot working for me (on mobile, non-password field). Shows up as
autocomplete="off"
in the HTML, which of course doesn't work. -
dlsso almost 8 yearsJuly 20 2016, neither this nor
new-password
are working for me on mobile for a non password field. Tried matchingname
, putting hidden fields both before and after, and JS hack. Chrome 51.0.2704.81 -
Ariel almost 8 yearsWorked perfectly on Chrome 51.0.2704.103 m (64-bit)
-
gozizibj almost 8 yearsIt prevent autofill, but how to disable autocomplete for password field
-
Olive over 7 years@Daniel, works in Version 52.0.2743.116 (64-bit) on macOS (10.12 Beta (16A304a)) - At least for me.
-
mccainz over 7 years@Vaia, adding the disabled attribute to the duplicate element will prevent it from being submitted.
-
danjarvis over 7 yearsThis solution worked because it does two things: 1. prevents chrome from displaying the 'use password for' under the real password field and 2. prevents chrome from asking you if you want to save the updated password (since the hidden password field which is marked as 'new-password' has no value)
-
AlexioVay over 7 yearsDo you have any sources how to figure this out?
-
Deminetix over 7 yearsAfter 2 hours trying other suggestions this works! Chrome 54.0.2840.71
-
Deminetix over 7 yearsThe reason this works is because the chrome team are trying to create recommended autocomplete values, as shown @ developers.google.com/web/fundamentals/design-and-ui/input/… The "new-password" value is one of the few that have additional logic surrounding it, and in this case, its to suspend autofill but still allow autocomplete suggestions
-
Robin Andrews over 7 yearsWorks, but is not semantic as can be used on username and other fields.
-
Mikal Schacht Jensen over 7 yearsUsing this approach I found that Firefox would still autofill the hidden fields, which would then be posted along with the rest of the form when submitting. Something that is not desirable with your credentials. Adding maxlength="0" prevents that.
-
Travis Tubbs over 7 yearsIt stinks that there is not a better solution than this... (no offense to you @mikenelson) offense to google chrome.
-
Brian Chance over 7 yearsThis stopped working for me as of Chrome 56. It started autofilling passwords for non-matching field names. Changed both inputs from
style=display:none
tostyle="visibility:hidden;height:0;width:1px;position:absolute;left:0;top:0"
. Thanks to @digital_flowers and @CodeSimian answers. -
Sajjan Sarkar about 7 yearsStopped working on Chrome 56.0.2924.87 . But the autocomplete="off" on the input worked.
-
Arnold Roa about 7 yearsThis does not work, both inputs, fake and new are yellow-autocompleted :(
-
Kuf about 7 years@ArnoldRoa version added, it's been on our site since the day I've posted it and had few versions where it worked fine. which version are you using? PC/Mac?
-
MiVvlt about 7 yearsstill works for me though, can you give some more details about what you are doing? Also: did you put the div with hidden inputs before the visible ones?
-
Admin about 7 yearsNot working on 57.0.2987.110. Chrome highlights it yellow and prefill the field with my saved password. But the page is a user management page, not login page.
-
Kuf about 7 years@Dummy I tested it now on chrome latest (57) and it's still working for me. Did you do anything special with the input fields? cap you put your code somewhere I could try to reproduce?
-
Louys Patrice Bessette about 7 yearsAs of 2017, this one still works fine. It just needs this script to force
input
focus if the user clicks on the "fake" placeholder :$("label").on("click",function(){ $(this).prev().focus(); });
Note that thelabel
cannot be before theinput
... Chrome finds it! Nice creative solution! +1 -
Mayrhofer about 7 yearsthe fake fields need to be after your real user/psw fields in dom - works in any browser (win & mac) for me.
-
Kevin Haag almost 7 yearsSetting
autocomplete="new-password"
is the only thing that worked for me. -
cristiancastrodc almost 7 yearsOn Chrome 58 this does not work. Use width:1px. If the password field is completely hidden, then Chrome autofills it normally. Also z-index:-999 could be useful so it does not overlap any content.
-
Admin almost 7 yearsThis answer works for me **** 6/5/2017 *** Version 58.0.3029.110 (64-bit)
-
jtate almost 7 yearsNONE of these solutions, whether it's an answer or something in the comments, are working for me as of Chrome 59. Does anyone have any other suggestions?
-
Victor Soto almost 7 yearsHaving problems with Chrome 59 as well.
-
The Lazy Coder almost 7 yearsI was able to get this working again.
style="height:0px; opacity:0"
-
Mike Purcell over 6 yearsTried this in Chrome 60 and doesn't appear to work :(, feels like IE hacking all over again...
-
Mike Purcell over 6 yearsThis didn't work as of Version 60. Chrome actually autoselects the first password from the list (along with matching email / name) when focus occurs. :(
-
Mike Purcell over 6 yearsThis did not work as of 8.30.2017 Version 60.0.3112.113 (Official Build) (64-bit)
-
Oliver Lloyd over 6 yearsFor react:
autoComplete="new-password"
-
Yuvraj over 6 yearsThis doesn't work in Chrome 61 as well. Has anyone found any solution to this?
-
Justinas over 6 yearsDocumentation page: developer.mozilla.org/en-US/docs/Web/Security/…
-
Caius Jard over 6 yearsThanks for the pointer of "a password field and the field before it" - worked out, when i changed the input so it was no longer a password field.. The users will have to suffer the inconvenience of seeing their new password, but at least I don't have to implement a password/confirmpassword pair :)
-
PellucidWombat over 6 yearsNot working as of 1.13.2018 Version 63.0.3239.132 (Official Build) (64-bit)
-
PellucidWombat over 6 yearsThis works for me as of 1.13.2018 Version 63.0.3239.132 (Official Build) (64-bit)
-
Palaniichuk Dmytro over 6 yearsIn my case I need only , tested Chrome v63 <input type="password" name="password" class="hidden-fields">
-
albertski over 6 yearsWorking in Version 63.0.3239.132
-
scipper over 6 yearsbest approach I found so far! well, at least for Chrome 64 :/
-
stackdave about 6 yearsis working with react 16, Chrome version 64: 'new-password' , I' don't know if work without react
-
Johann Combrink about 6 yearsworks like a charm Version 64.0.3282.186 (Official Build) (64-bit)
-
johntrepreneur about 6 yearsThis is misleading though, as the field has a grey background indicating to the user that it is disabled (which it is) and shows the banned cursor when hovering over it. Only when the user clicks it, which they wouldn't normally do since the styles tell them not, does it actually start working. It may work, but is counter intuitive IMO and bad UX. I suppose you could add styles to address this though.
-
Regular Jo about 6 yearsRE: 'unexpected behavior' This behavior is pushed by Google who believes it knows better than developers how every single page should work. Sometimes I just want a raw password input, zero frills.
-
Regular Jo about 6 yearsThis no longer works, frustratingly. I have a 'change password' form, and Chrome offers offers
Use password for
on every single one of them, no matter what I've tried including this. -
L. Guthardt about 6 yearsWhile this code snippet may be the solution, including an explanation really helps to improve the quality of your post. Remember that you are answering the question for readers in the future, and those people might not know the reasons for your code suggestion.
-
billy jean about 6 yearsVersion 64.0.3282.186 (Official Build) (64-bit) Windows. 2018-03-01 NOT WORKING for disabling autofill.
-
billy jean about 6 yearsthis combination FINALLY worked for me: role="presentation" autocomplete="nope" tested on Chrome Version 64.0.3282.186 (Official Build) (64-bit). What a nightmare!
-
SantiBailors about 6 yearsThe first colon in the 2nd line is probably a typo.
-
Johannes about 6 yearsI agree with L. Guthardt. Please provide a complete example that showcases your solution, preferably on jsfiddle, jsbin, codepen or similar demo website.
-
Khaleel about 6 yearsthis is the only solution worked for me out of all other workarounds in the internet. this works in safari where I had problem. what a stupid bug and wat a good fix. btw I need to add
onblur="this.setAttribute('readonly', true);"
to make it work perfectly -
tleveque about 6 yearsThe of using fields with display:none does not work anymore since Chrome 66. Chrome will not autofill if not displayed. You now have to make it invisible. Set the width, height and border to 0 and background transparent (rgba(0,0,0,0))
-
9swampy about 6 yearsworked in Vue until I updated and memorised the password on the login view again now it's started autofilling again.
-
IQtheMC about 6 yearsCan't believe this worked. I added the dummy element to a random username field that is for searching other usernames and didn't have any password field near it, using the bootstrap class 'hidden', then when I loaded the page again the input was clear, but one of my other inputs called Email Address was now populated with the username. So then I had to add a dummy class before the Email Address input and that ID needed to have the words 'email' and 'address'. That solved the problem.
-
curiousguy about 6 years@Mark42 "it's usually for a good reason" It's often for a bad reason (security). Hence, the arm race.
-
Ales about 6 yearsFor my text input not used for password works this: <input id="townInput" type="text" name="town-name" autocomplete="new-town-name" autocorrect="off">
-
JaySon almost 6 yearsDoes not work for me with React and Meteor. Chrome Version 66.0.3359.139
-
Moos almost 6 yearsSo
name
orid
attribute has to be session-unique so that autofill doesn't kick in. Alternatively leave out name/id and giveautocomplete
attribute a unique value (like+(new Date())
). Examples here: jsfiddle.net/mfdc22pz -
hungmi almost 6 yearsI copied autocomplete="off" from google map, and it works on chrome version 66.
-
dubrox almost 6 years@mikenelson thanks a lot for the trick, but please update the answer, as
display:none;
doesn't work anymore, butposition: fixed;top:-100px;left:-100px; width:5px;
does :) -
Admin almost 6 yearsIt doesn't work. I'm trying with Chrome 67. Nothing. I still need a fake input with
display: none
! Very crazy! -
sKopheK almost 6 yearsnot working in Chrome 67, in Firefox 60 only on first focus, then with no readonly attribute it keeps offering stored passwords for certain user
-
Douwe de Haan almost 6 yearsSince your answer is the most recent one, could you please add that adding
autocomplete="pineapple"
or some other gibberish also seems to fix the problem? At least, it did on my end! -
Sten Muchow almost 6 yearsAs of July 2018 - this is working... but must be named new-password
-
ChronoFish almost 6 yearsThe random string works for chrome but not firefox. For completeness I use both "autocomplete='off-no-complete'" and set the readonly attribute with an onfocus="this.readOnly=false". My app is an enterprise appliation that users use to input thousands of addresses, so the use-case to control this is real - I can also guarantee the use of Javascript, so at least I've got that going for me
-
Junior Mayhé almost 6 yearsWorks on Chrome 67.0 on angular html component
<form *ngIf="!loggedIn()" #loginForm="ngForm" class="navbar-form navbar-right" (ngSubmit)="login()"><input type="password" style="width: 0;height: 0; visibility: hidden;position:absolute;left:0;top:0;"/><input type="text" #username="ngModel" placeholder="Username" class="form-control" required autocomplete="off" name="username" [(ngModel)]="model.username"><input type="password" #password="ngModel" placeholder="Password" class="form-control" required autocomplete="off" name="password" [(ngModel)]="model.password">...
-
Matt Morgan almost 6 yearsWorked Google Chrome 67.0.3396.99 (Official Build) (64-bit) (cohort: Stable)
-
Zenoo almost 6 years@mikenelson Since the
autocomplete
attribute doesn't seem to be doing much lately, I posted an answer which seems to be working, at least for me and the ones who tested it. This question has so many answers I feel like it won't ever be seen. If you deem it good, would you mind adding it to your post? Thank you :) -
mike nelson almost 6 years@zennoo - your onfocus trick sounds like a good way to disable the autocomplete dropdown that usually appears whereas we are trying to disable autofill which is where it highlights eg Email fields in yellow and puts your email address in them before you even focus the field. Changing the field name does not prevent this behaviour unfortunately
-
ivan_pozdeev almost 6 yearsChecking the DOM over a billion times for each received request? No comments.
-
ivan_pozdeev almost 6 yearsThis inserts that nonbreaking space into the input.
-
Cam Tullos almost 6 yearsYou have to make sure the input has a name or id. The browser binds what to autocomplete via attribution. Once you do that, autocomplete='false' should work fine.
-
Cam Tullos almost 6 yearsSorry... meant autocomplete='off'
-
png almost 6 yearsAutocomplete and autofill are not the same. Using the autocomplete attribute will NEVER disable autofill. I'm guessing that's why this isn't working for half of you. Autofill can only be disabled through the browser settings.
-
png almost 6 years@CamTullos, it's true that autocomplete binds to the name attribute. But autocomplete off is doing nothing. You changed the name attribute and therefore no autocomplete values are bound yet.
-
mothmonsterman over 5 yearsautocomplete="off" is working again now as of Chrome Version 68.0.3440.106 (Official Build) (64-bit)
-
mothmonsterman over 5 yearsautocomplete="off" is working again now as of Chrome Version 68.0.3440.106 (Official Build) (64-bit)
-
Andy King over 5 yearsYes! :) Thank you! This works in Chrome 67.0.3396.99. (I think your link should be: w3.org/wiki/HTML/Elements/input/search as of September 2018).
-
Venson over 5 yearsFinally! still works Version 69.0.3497.100 (Official Build) (64-bit) This should be the real answer!
-
Matt over 5 yearsThis no longer works for me in 69.0.3497.100 (October, 2018).
-
Camille over 5 yearsWith chrome 69.xxx, I done that to remove stop autocomplete
<input type="text"><input type="text" style="display:none"><input type="password"><input type="password" style="display:none">
-
Camille over 5 yearsWith chrome 69.xxx, I done that to remove stop autocomplete
<input type="text"><input type="text" style="display:none"><input type="password"><input type="password" style="display:none">
-
Esko over 5 yearsYou should edit the question, autocomplete="off" works fine in todays Google Chrome.
-
Day Davis Waterbury over 5 yearsI love you. The only solution on this page that actually works.
-
Zabba over 5 yearsIt doesn't work in 70.0.3538.77 (Official Build) (64-bit) @Esko. I think it is safe to say that the Chrome team really doesn't care about a valid use case where you want the auto complete off: in a web app's settings page where you want the user to type in a new email address for their account (the user want's to change the email address on their account)
-
Doug McLean over 5 yearsFor my purposes this is perfect, thank you! Chrome doesn't autofill or autocomplete it, doesn't offer to save it, and not only is it obscured from view but also from the clipboard - I copied what I'd typed and pasted it into notepad and just got "•••••••••••". Brilliant!
-
ChrisDeDavidMindflowAU over 5 yearsactually this works with PHP: ``` <input type="text" name="whatever" autocomplete="off_<?php echo time() ?>"> ``` This disabled the autofill on Chrome at 30-Nov-2018
-
Robert over 5 yearsWorks the best for me. Thanks for that.
-
redfox05 over 5 yearsIt's worth noting that to solve the OP's problem, you don't need to disable autocomplete, you can just give autocomplete labels to tell the browser what type of info the field is for, that way, the right info would more likely go to the right field. See here on the list of autofill attribute values: html.spec.whatwg.org/multipage/…
-
redfox05 over 5 yearsNote: Not every browser has implemented the more specific autofill values, see this page where were they tested which browsers used what to identify fields: cloudfour.com/thinks/…
-
demopix over 5 yearseverybody is right and wrong and the same time you should write autocomplete="off" inside the tag <form autocomplete="off" > instead on input and this will stop the autofill behavior
-
Admin over 5 yearsConfirmed - this is the only correct answer here that doesn't break proper form structure. Works as of Dec 2018 in all current browsers
-
GerardV over 5 yearsDoesn't work anymore. A working 'solution' (for me) is supplied here: stackoverflow.com/questions/12374442/…
-
digout over 5 years@DouwedeHaan this is fine until the form gets saved, then autocomplete will provide recommendations for saved 'pineapple' field. But maybe using a random hash for autocomplete value for example would get round this?
-
Douwe de Haan over 5 years@digout I agree. A good example would be to use the UUID for this kind of stuff. Just make sure that the string is unique!
-
John over 5 yearsAlso works if you set autocomplete="off" on the form (to change that default form-wide) and then just need to set type="search" on the <input>
-
Primoz Rome over 5 years@dsuess I am still getting autocomplete box on this example jsfiddle.net/danielsuess/n0scguv6. Google Chrome Version 71.0.3578.98 (Official Build) (64-bit) , OS X Mojave.
-
Richard Garside over 5 yearsOriginal bug has been marked as won't fix. Someone has reopened here bugs.chromium.org/p/chromium/issues/detail?id=914451 please star it if you think this should be fixed.
-
Rob over 5 yearsI am not working within a form and I have an input field showing a date in a UL how can I get this to work? THe autocomplete="new-password" still does not stop the autocomplete from trying to fill it in.
-
Olex Ponomarenko over 5 yearsPretty sure this removes the form / input from assistive technologies w3c.github.io/using-aria/#ariapresentation
-
scrfix over 5 yearsA new approach that I have not seen: The autofill menu in chrome relies on the input type name.
-
scrfix over 5 yearsA new approach that I have not seen: The autofill menu in chrome relies on input type name. Generating and storing a random number for the name prior to form creation then filtering it out if you need to use the name dynamically and upon form submission. Example: <?php $random_num=date().time()*mt_rand(); ?> <input type="text" name="name<?php echo $random_num;?>"> name=name5904923992050214 which would disable the chrome autofill menu from appearing. Since we filtering out 5904923992050214 we can still use the name. This method should work for dynamic language forms.
-
Adam over 5 yearsConfirmed this is working Chrome: 71.0 for putting a dummy password element as the first element in your form immediately after <form> open tag - sooo happy!
-
Dzak about 5 yearsChrome version 72.0.3626.121 (Official Build) (64-bit), This is the only solution that worked for me...
-
westor about 5 yearsAs I learned, autocomplete is not autofill. Therefore setting autocomplete does not help to prevent autofill. Autofill uses e.g. label text around the input, and if it matches to something like 'number', credit card information may be suggested. It seems to be impossible to switch off that. My solution was to modify the label with zero-width witespaces. Assume you have your label information available in js, you may use the following simple code: label = label.split('').join('​'); In HTML you can simply put a '​' between parts of your label like 'nu​mber' or 'ca​rd'.
-
Adheep Mohamed Abdul Kader about 5 yearsAfter Chrome version 72.XX, this fix does not work. Find the lastest fixe here stackoverflow.com/a/55045439/1161998
-
MSC about 5 yearsFWIW, google's latest explanation: developers.google.com/web/updates/2015/06/…. "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."
-
Prabo about 5 yearsThis is the only solution that worked for me. Works in newer versions of chrome too
-
Eddy Howard about 5 yearsI just wanted to say.. After stumbling across this issue.. Chrome is a real piece of work. So now we must jump through hoops to disable functionality that was supposed to remain optional. In what world would address autofill be needed in a business application where the address is new / different every time. Google is becoming just as bad as Microsoft.
-
vijay kumar about 5 yearsgive name as which field auto populating. .hide-input{ width: 0; height: 0; border: none; position: absolute; } <input type="text" value="" name="username" class="hide-input" />
-
Scratz about 5 yearsThe first part of this answer doesn't doesn't appear to be true anymore: Chrome Bug
-
Chris Pratt about 5 yearsI'm not sure what you're on about. That "bug" is just a placeholder for Chromium to collect people's use cases for
autocomplete="off"
. It's possible the intent is to remove it, but that's not ever explicitly stated, and there's certainly nothing requiring that mental leap. They may just be wanting to consider alternate or better ways to treat it. Regardless, it's still part of the spec, and again, no indication that it will be leaving the spec either. And, it still works in all browsers as far as I'm aware, including Chrome. -
Scratz about 5 yearsWe have a couple of cases where autocomplete="off" is not being respected by Chrome.
-
Chris Pratt about 5 years1. A couple of anecdotal cases does not amount to evidence. 2. As I said in my answer, form filling extensions and the like may not and often do not respect this. Ultimately, like all things, it's up to the client, and therefore the user. All you can do is suggest that it should not be autofilled.
-
Matt Smith about 5 yearsFor my purposes I needed to insure the field didn't get auto populated AFTER it lost focus.
<input type="password" readonly onfocus="this.removeAttribute('readonly');" onfocusout="this.setAttribute('readonly', 'readonly');"/>
-
jinglesthula about 5 yearsHere's where the Chrome autofill source code is. chromium.googlesource.com/chromium/src.git/+/refs/heads/master/… Anyone able to dig in and see how it determines fields to target for population? It may be we can defeat the approach it uses as long as we know what the approach is.
-
mkbctrl almost 5 yearsThis solution is not completely valid. It turns off the autocomplete, but the autofill feature is still intact. Here is the video with the solution: youtube.com/watch?v=tJTaCFdYXrw&feature=youtu.be In order to get rid of both of them, you have to add custom value to the name attribute, set the autocomplete to off, and change the input type to search. And remember the Autofill and Autocomplete are not the same thing in Chrome
-
Kennyomar almost 5 yearsSimilar for me. I applied it to the password field. Applying to the form or other fields didn't work for me. I'm using Chrome Version 75.0.3770.142
-
Jeffz almost 5 yearsDoes NOT work as of Chrome 75.0.3770.142. Chrome is a mess.
-
Praveen Dabral almost 5 yearsWorked for me Chrome Version 75.0.3770.142
-
Jon Ediger almost 5 yearsI was able to get a modified version of this working in chrome, firefox, and edge. set autocomplete="off" for the Form element set autocomplete to something invalid, like none, for each input element. Note: lots of info online says the browsers now treat autocomplete='false' to be the same as autocomplete='off'. At least as of right this minute, it is preventing autocomplete for those three browsers. <form autocomplete="off"> <input type="text" id="lastName" autocomplete="none"/> <input type="text" id="firstName" autocomplete="none"/> </form>
-
Fitz over 4 yearsBut the suggest will popup as usual when I focus a password type input.
-
Norman Xu over 4 yearsApparently google is trying to make decisions for all of us here, they closed the ticket regarding autocomplete="off": bugs.chromium.org/p/chromium/issues/detail?id=468153. But there is another ticket opened for collecting valid user cases for disabling autofill, please reply this ticket to raise more awareness of this issue here: bugs.chromium.org/p/chromium/issues/detail?id=587466
-
Julesezaar over 4 yearsIt only works for password autocomplete="new-password", email (="new-email"), username (="new-username") . For all the other fields that DO NOT have the string ..."blabla-password"... "email-blabla"... "bla-username-bla" in the id or name you must still use 'off' to have the best result!
-
V H over 4 years76.0.3809.100 is leaving some random username in some email field in a vuejs site - had to enable it for all form actions due to templates - is causing other side issues now - upon removing it the username no longer appeared in the email field. strange
-
Andres Paul over 4 yearsIt might sound really odd, but
autocomplete= "new-password"
only worked for me if the name of the input wasname="password"
.My previous name wasname="old-password"
and changing it did the trick. I hope it helps you ;) -
hkarask over 4 years
autocomplete="new-password"
and not using input name as "password" worked for me. -
SamJakob over 4 yearsFor some common forms - e.g. username/password, Chrome seems to identify the type attributes of the elements and suggest autofill accordingly, so a workaround for this is to set a form input that would normally be
text
tonumber
and then after a 500mssetTimeout
change the input type back to text. -
Nucleon over 4 yearsI was able to get this to work by setting the "name" attribute to Date.now(). I'm using a dynamic input so we don't ever actually use the real name value and it magically worked in Chrome 78... for now.
-
DKR over 4 yearsawesome awesome solutions
-
mendez7 over 4 yearsNone of the autocomplete attribute values worked for me. I am using Chrome 79.0.3945.88. All I wanted was to disable the autofill suggestion for the password field. I did that by making the input type text in html then changing the type to password in javascript on initialisation of the page. E.g: Html:
<input type=text id=myPassword>
JS with jquery:$(function () { $('#myPassword').attr('type', 'password')});
-
Codezilla over 4 yearsThe correct answer is now autocomplete="disabled" off and false values do not work anymore
-
GDY over 4 yearsI've just used <form autocomplete="off"> in chrome and it works for me
-
3Dom about 4 yearsThis no longer works. Once you've provided details for a field before, it will remember, no matter what you call. It. The solution (to trick it), is to change the name="whatever" and placeholder="whatever" to be unique on every load. In my case, I've added a timestamp (secs since epoch) after those. So they become name="whatever1584167734" and placeholder="whatever1584167734". That fixes it. I have my own autosuggest box which was being out-z-indexed by Chrome's autosuggest.
-
3Dom about 4 yearsAdditionally, I'll add that if you're intending on submitting the form more than once on the same page, you'll need to rename the field attributes after each form submission if you want to stop it from happening.
-
Avatar about 4 yearsYou can just add
autocomplete="off"
to the input field instead of using jquery. And by the way, this does not work. Chrome password suggestions are still showing up. -
Joshua Soileau about 4 yearsThank you thank you thank you. This did it for me. We have an address form where the street input has a custom auto-complete that we implemented, but the chrome AutoFill/AutoComplete always appears on top of ours. This fix did it.
-
anilyeni about 4 yearsAs I noticed, autocomplete="off" works on Chrome 80, IF there is less than 3 elements in <form>. I don't know what is the logic or where the related documentation about it.
-
Nithin Baby about 4 yearsJust to add on, giving
autoComplete="new-password"
to the password field made sure that other fields like username are also not autofilled now. You don't have to add any extra attributes to fields other than password -
Pankaja Gamage about 4 years
autocomplete="something-here"
used to work but not anymore. Also tried theautocomplete="chrome-off"
and it doesn't work either. Just seems like another variation of adding some gibberish for the parameter -
Matt Smith about 4 yearsWe run our business on Chrome. It's beyond frustrating that even providing autocomple="someRandomString" no longer works. This needs to be addressed in the standards and Google Chrome needs to adhere to those standards or they too will fall to the sidelines like Netscape Navigator and Internet Explorer.
-
Alex from Jitbit about 4 years
chrome-off
worked for me in Chrome 81. Also - how is everyone doing? I've had 2 kids since I first came to this question. Stay healthy! -
Vladimir about 4 yearsJust tried
chrome-off
, didn't work for me, wtf! Chrome 81 -
sagar1025 almost 4 yearsUpdate Chrome version 83 -
chrome-off
does not work, however, using a dummy password field along with the styles seems to work as Mike Nelson mentioned.<input type="password" id="dummy-pwd" style="position: fixed;top:-100px;left:-100px; width:5px;">
Just make sure this input field is of typepassword
and it should be placed BEFORE the realpassword
field. What happens here is the autofill finds the FIRST input field of typepassword
and fills it. In jquery$('#dummy-pwd').val()
returns the "autofilled" password while the real password field is empty. -
Dino almost 4 years
autocomplete="new-password"
won't do the auto-fill, but once you click on the password field you will still get a suggestion prompt. I can't believe that it's been years and they still didn't resolve this. -
auron344 almost 4 years@sagar1025 Tried it. It doesnt work neither...Its like password manager (no autofill) doesnt give a fuck about how many password inputs you put. It appears for every input you have if it is of type password, simple as that. If you give him the order to store the password you used before, it will always shows to let you choose the password
-
Googie almost 4 yearsI noticed that you also need to pay attention to the
name
attribute of your input. I also named it usingnew-something-something
pattern and it seems to have helped. I missed that previously, as AngularJS assigns thename
on-the-fly basing onng-model
value. -
alfoks almost 4 yearsregarding the new-password, you can read here the expected behaviour. Scroll to "The autocomplete attribute and login fields". developer.mozilla.org/en-US/docs/Web/Security/…
-
virtualmic almost 4 years
autocomplete="new-password"
works as per: developer.mozilla.org/en-US/docs/Web/HTML/Attributes/… -
Chuck over 3 yearsNothing really works here with Chrome. I'm using plain-text boxes now.
-
ddruganov over 3 years"text-security" is not a valid css property as of october 2020
-
Dustexe over 3 yearsHello. Had to use
autocomplete="off"
. Chrome version 85+. -
eheydenr over 3 yearsSuper, thank you, after searching and trying, this finally solved it!
-
Admin over 3 yearsOnly
autocomplete="off"
is working for me with Chrome v.85/85 on MacOS 10.15. -
Thales Kenne over 3 yearsThis is the only way I could make it work in 2020: stackoverflow.com/questions/60689757/…
-
Rob over 3 yearsOnly answer that still actually works at the moment.
-
Craig Howell over 3 yearsVersion 86.0.4240.111 nothing works. I used to get by with a autocomplete="off" and hidden password and email fields on all forms. I have tried "new-password" "chrome-off" "dont-use-autocomplete I-dont-like-it" nothing has any effect and autocomplete continues to show up for random fields. some still don't show it but I can't make heads or tails of why they are not and the others are.
-
Chaoste over 3 yearsRunning on "86.0.4240.111 (Official Build) (x86_64)" and tried all the above mentioned approaches but nothing worked for me: hidden password field, "chrome-off"/ "off"/ "no"/ any other value for all inputs and the overall form. Very critical for a page if the autofill window actually breaks the hovering logic of the login widget and thus disappears. I'm really angry that the Chrome developers making us a difficult time with this...
-
Igor Bukin over 3 yearsHm, Version 86.0.4240.111 (Official Build) (64-bit) on Ubuntu correctly behaviors only with autocomplete="off". Neither "chrome-off" nor "new-password" didn't help
-
sandstrom over 3 yearsHere are two Chrome issues you can comment on if you want them to change this behavior: bugs.chromium.org/p/chromium/issues/detail?id=587466 and bugs.chromium.org/p/chromium/issues/detail?id=914451
-
Gokhan Kurt over 3 yearsPeople are misunderstanding something.
off
,chrome-off
,whatever
are all just strings. They don't have special meaning in this context. I thinkautocomplete
attribute acts like the name field, but for autocomplete. Google just saves your previous form submit with this autocomplete string. -
Shadoweb over 3 yearsFor people using the fake hidden field remembrer to to add a
tabindex="-1"
to avoid the tab disappearing. -
Corey over 3 yearsNone of the answers work for me. What in the world disables Chrome autofill?
-
Davide C over 3 yearsautocomplete="chrome-off" is working on my chrome on last osx. We need a consistent solution from google..
-
Rich Andrews over 3 yearsMy experience involved erroneous autofilling on a lone <input> element, which is valid. When that input element was provided a parent <form> then Chrome 87 stopped erroneously autofilling an input element that clearly had nothing to do with the autofill chrome was using.
-
sam over 3 yearsThis worked for me but only tested on Chrome.
-
rickvian over 3 yearsi tried autocomplete="off" alone doesnt work, after adding role="presentation" along that, makes it work
-
wsyq1n about 3 yearsThis does not address the issue being discussed. It is about how to STOP Chrome from autofilling. Not "how to create forms properly." Either that or your TLDR doesn't fully following through on what you're addressing or the outcomes.
-
Muhammad Rosyid about 3 yearsI get good explaination here developer.mozilla.org/en-US/docs/Web/Security/…
-
Rei Miyasaka about 3 yearsNot working on latest Brave or Edge on Windows. Only thing that works is
autocomplete="<anything other than off|on or other valid value>"
on every affected field. -
Ruben about 3 yearsThanks! But what a load of crap man.
autocomplete="off"
works for me now in chrome 88, but only for regular inputs. I did not test it on password fields. -
Gavin about 3 yearsI'm trying in Chrome 89.0.4389.90 on macOS and it's not working :/
-
Latchy about 3 yearsSo on Win 10 Chrome 89 my only solace came from prepending the autocomplete property with "new-", eg.
<input autocomplete="new-email"/>
-
Oleg Abrazhaev about 3 yearsthis is the only working thing in chrome 88 at Mac at the moment.
-
Jaden Baptista about 3 yearsThis isn't working in my newest version of Chrome now.
-
tmarois about 3 yearsAs of 2021: this has worked for me,
autocomplete="chrome-off"
-
Thameem about 3 years2018th solution works in 2020 for me.. Thanks for such a long answer!!
-
Appoodeh almost 3 yearsI prefer to use this instead:
<input type="text" onfocus="this.setAttribute('type', 'password');"/>
-
Gopal Mishra almost 3 yearsThis worked for me: Setting <form autocomplete="chrome-off"> <input id="password" style="position: fixed;top:-100px;left:-100px; width:5px;" type="password" name="password"> <input type="password" autocomplete="not-at-all" id="actualPassword"/> </form>
-
Artyom Krasnyuk almost 3 yearsWho is looking how to hide built-in browser styling for the input type search: (SCSS): input[type='search'] { /* clears the 'X' from Internet Explorer / &::-ms-clear, &::-ms-reveal { display: none; width: 0; height: 0; } / clears the 'X' from Chrome */ &::-webkit-search-decoration, &::-webkit-search-cancel-button, &::-webkit-search-results-button, &::-webkit-search-results-decoration { display: none; } }
-
demoncodemonkey almost 3 yearsNone of these work for me, I give up. Congratulations Chrome you win.
-
Dorian almost 3 yearsin some cases
none
works and in some casesoff
works :shrug: -
mediaguru almost 3 yearsThis works, BUT now the cursor styling shows as not allowed.
-
Rahul Sonone almost 3 yearsautocomplete="none" this worked for me autocomplete="off" is not working.
-
Girish Sasidharan almost 3 yearsinstead of
autocomplete="off"
setautocomplete="new-password"
for all<input>
you want to stop auto-filling -
Joe Solano almost 3 yearsIn Chrome 91 on Windows I have not been able to get Chrome to stop auto filling, Neither autocomplete="off" nor autocomplete="chrome-off" worked
-
row almost 3 yearsnew-password, works see developer.mozilla.org/en-US/docs/Web/HTML/Attributes/…
-
Alex Stephens almost 3 yearsAs simple as putting your input into a form.
-
Bruno Schäpper almost 3 yearsThis is a good solution, if you don't mind Javascript. I found Chrome still adds a password after clicking around the page a bit, so i re-enabled the field in an
onmouseover
event listener. -
manuel-84 almost 3 yearsas said in this comment (stackoverflow.com/questions/15738259/…) adding role="presentation" to the input fields makes autocomplet="off" works also for address autofills
-
dimitar almost 3 yearsThis one works for me too. All other options "off", "false", etc. not working
-
Fabiano Taioli over 2 yearsVersion 93.0.4577.82 chrome-off not working anymore
-
CodeConnoisseur over 2 yearsNone of the autocomplete options from above work on
Version 96.0.4664.45 (Official Build) (64-bit)
-
simon over 2 yearsThank you, only solution working for Chrome 96 (December 2021).
-
Andrew over 2 yearsStill broken
Version 96.0.4664.110 (Official Build) (64-bit)
-
ÄR Âmmãř Żąîñh over 2 yearsThe legend answer thank you maaaaaaaaan
-
Jaxx0rr over 2 yearsautocomplete="chrome-off" works for me only if one of the input text elements has it.. if all have it it stops working
-
ryan over 2 yearsI have been setting
autocomplete="<random 12 character string>"
... obviously not an ideal solution, but its the only way i've been able to consistently turn it off -
jaypat32 over 2 yearsYour update from Sept 2020 did not work for me. Using just "off" worked for me. I'm on Version 97.0.4692.71 (Official Build) (64-bit) of Chrome.
-
mikael1000 over 2 years@Appoodeh This don't work in my Chrome password field. Well i don't get the autocomplete, but it stays as a text input (no dots) and I also have to use the autocomp.. off.
-
phunder about 2 yearsFeb 2022 - None of the suggestions works, even using hidden inputs. I managed to get it working by adding normal inputs and hiding them with height: 0; opacity: 0; margin: 0; padding: 0; (display: none did not work either) Chrome version 98.0.4758.102
-
Furkan about 2 yearsI found this one. It disables on chrome, edge and opera <form autocomplete="off"> <input role="presentation" /> </form>
-
Lakatos Gyula about 2 yearsThe Chrome team deserves a big middle finger in their face tbh. Sometimes you just want to disable the autocomplete because it makes no sense (business logic wise, etc).
-
Vincent almost 2 yearsUsing autocomplete='whateverrandomvalueyouwant', in other words, using an unrecognized value, is automatically converted to autocomplete='new-password' by chromium and this is apparently now honoured by chrome but not edge.
-
Vavaste almost 2 yearsIf you have an input type="password" with chrome Version 103.0.5060.53 (Official Build) (x86_64) The only solution to deny the autofill seems to change the type to "text", give an id/name that is not recognizable as a pwd by chrome, set autocomplete="false" and use css to recreate the "password dots" <input className="textareaProfile centerElement placeholderBlack fakePwd" type="text" id="id2" placeholder='Nuova password' autoComplete="false"/> .fakePwd{ -webkit-text-security: disc; }
-
Nuno Ribeiro almost 2 yearsrevolve my problem with autocomplete="pineapple" ahah!! The dumbest workaround of my life :D Thx a lot! :D