Autocomplete = "new password" does not work and the "use password for" drop-down is still displayed

I created a registration form with the input text for the username and type password for the user using visual studio 2010. I have the latest version of Chrome version 59.0.3071.115 (Official Build) (32-bit version). Below is my code:

<form id="form1" autocomplete="off" runat="server"> <input id="Text1" type="text" name="text" runat="server" autocomplete="off" /> <input id="Password1" type="password" name="password" runat="server" autocomplete="off" /> </form> 

the problem is that only on chrome, if I click on any of these inputs, a drop-down list appears with some suggestions of my saved passage in the browser. I want to disable this option in order to find and find this solution:

 <input id="Password1" type="password" name="password" runat="server" autocomplete="new-password" /> 

The new password will disable autocompletion, because it will take into account that every time the user enters a new pass, so there is no need for suggestions. But this does not happen here ... in fact, when I added a new password to enter pass , the drop-down list disappeared for the input text , but it still appears to enter pass ... Weird ... Since I can disable it for both inputs? Thanks

+9
source share
1 answer

You can prevent Chrome from offering by adding two hidden fake fields, and by adding autocomplete="off" to the form and autocomplete="none" to the main inputs.

Here is a working sample:

 <form id="form1" autocomplete="off" runat="server"> <input style="display:none" type="text" name="fakeusername"/> <input style="display:none" type="password" name="fakepassword"/> <input id="Text1" type="text" name="text" runat="server" autocomplete="none" /> <input id="Password1" type="password" name="password" runat="server" autocomplete="none" /> <input id="bb" type="submit" name="submit" /> </form> 

Jsfiddle: https://jsfiddle.net/wb20t08g/3/

NOTE. You need to delete the Google Chrome suggestions that were saved there earlier. ( Ctrl + Shift + del ). But after that, if you click Submit, Chrome will not display pop-ups mentioning whether you want to save a password or a drop-down list for offers.

0
source

Source: https://habr.com/ru/post/1270259/


All Articles