Click here to Skip to main content
15,886,807 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Hello guys, how to disable google chrome input fields auto filling in 2020. I try with:

<form autocomplete="off"> 
<input type="text" id="input_name" autocomplete="none"/>

Also try: autocomplete="somethingelse"



Do you know any new solution? Please don't give old advice or links of examples if you don't have tested that solution in 2020. 

Thank you.


What I have tried:

Also i try some old fashion things but with the latest update of Google Chrome i cannot disable auto filling of the input fields.
Posted
Updated 14-Apr-20 3:27am

I would read through the specifications on the autocomplete attribute from various credible sources.

According to w3schools, the only valid values are on or off
HTML input autocomplete Attribute[^]

According to MDN (Mozilla Deliver Network, the makers of FireFox), there is a variety of values that can be used in there; however what happens in other browsers is not guaranteed
The HTML autocomplete attribute - HTML: Hypertext Markup Language | MDN[^]
NOTE:
The autocomplete attribute also controls whether Firefox will — unlike other browsers — persist the dynamic disabled state and (if applicable) dynamic checkedness of an <<input> element, <textarea> element, or entire <form> across page loads. The persistence feature is enabled by default. Setting the value of the autocomplete attribute to off disables this feature. This works even when the autocomplete attribute would normally not apply by virtue of its type.

Now if we go to W3C (World Web Consortium), the actual standards organization; they do not have listed out actual values. What they do have which may be helpful is how the DOM has it represented: attribute boolean autocomplete, and boolean generally is accepted as a true or false.
HTML5 Reference[^]


In Summary
There are standards that can be followed and you can hope that the browser honors what you have requested. But, as evidenced by the MDN link above; browsers may extend that functionality so you never know what they do or do not support. Nevermind that many people have extensions added onto their browsers that can further interfere or augment this.


An observation
One of the heavily secured websites I sign into is using Angular Material UI design components, and they have leveraged those components quite nicely to NOT save or fill in login credentials.
You may want to browse through their write-up and code to see if this can help you out.
Angular Material UI : Autocomplete overview[^]
 
Share this answer
 
v2
Comments
Richard Deeming 14-Apr-20 9:21am    
That W3Schools link is just wrong - the attribute accepts many more options than just "on" or "off":
The HTML autocomplete attribute - HTML: Hypertext Markup Language | MDN[^]
MadMyche 14-Apr-20 9:41am    
I am going to update with that link as well, and the caveat that they have regarding that this is what Firefox is supposed to do; as well as adding the link in to the w3c
JordanTrajkov 14-Apr-20 10:27am    
I'm using asp.net controls and nothing from your answers didnt works, i use W3C Standards and MDN but nothing works, i can still see auto generated list if i click on the input field.
You haven't provided a lot of details, but I'm guessing you're trying to disable autocomplete on your login form.

That's a very bad idea. By doing that, you are trying to force users to choose extremely weak passwords, and encouraging them to reuse the same password across multiple sites. That's why all modern browsers will ignore autocomplete="off" for login forms.

If you're writing a "user management" page, where you can set passwords for other users, then you can use autocomplete="new-password" on the password field, which most modern browsers respect. But do not use this on your login form!

How to turn off form autocompletion - Web security | MDN[^]
 
Share this answer
 
Comments
JordanTrajkov 14-Apr-20 10:24am    
I'm trying to turn it off on a normal form for Client First Name and Country name, not in password, and the autocomplete="new-password" or anything else similar to this is not working. I'm using asp.net components.
Richard Deeming 14-Apr-20 10:28am    
If you're using an ASP.NET <asp:TextBox> control, you'll need to set AutoCompleteType="Disabled", which will then render the autocomplete="off" attribute for that control.
JordanTrajkov 14-Apr-20 11:59am    
Yes i test it as well, i add AutoCompleteType="Disabled" which is render to autocomplete="off", but it doesnt stop appering of autocomplet list undet the field.
Richard Deeming 14-Apr-20 12:09pm    
Sounds like you're getting autofill, rather than autocomplete. This deliberately ignores autocomplete="off" as a policy decision.

The only way to work around that seems to be to give the attribute a value that Chrome doesn't recognise.

forms - 2019, Chrome 76, approach to autocomplete off - Stack Overflow[^]
468153 - chromium - An open-source project to help move the web forward. - Monorail[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900