Autocomplete = “new password” not working and “use password for” dropdown list still shown

前端 未结 1 1427
面向向阳花
面向向阳花 2021-02-19 02:00

I created a login form with input text for username and input of type password for userpass using visual studio 2010. I have the latest chrome Version 59.0.3071.115 (Official Bu

相关标签:
1条回答
  • 2021-02-19 02:42

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

    Here's 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 google chrome suggestions that have been saved there from before. (Ctrl + Shift + del). But after that if you click on submit, Chrome won't show any pop-up mentioning if you want to save the password or any dropdown for suggestions.

    0 讨论(0)
提交回复
热议问题