且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在用户标识密码字段中自动完成关闭或停止

更新时间:2023-11-04 16:13:58

< input>:输入(表单输入)元素 - HTML:超文本标记语言MDN [ ^ ]

<input>: The Input (Form Input) element - HTML: HyperText Markup Language | MDN[^]
<ul>
  <li>
    <span>UserName: </span>
    <input id="UserName0">
  </li>
  <li>
    <span>Password: </span>
    <input id="Password" type="password">
  </li>
  <li>
    <span>Confirm Password: </span>
    <input type="password" id="Password0" autocomplete="off">
  </li>
</ul>


Quote:

如何自动完成或在userid密码字段中停止

How to auto complete off or stop in userid password field



一个关于web开发的非常好的教程网站:

HTML输入自动填充属性 [ ^ ]


您通常无法禁用浏览器的登录字段自动填充选项:

You generally can't disable the browser's autocomplete options for login fields:

现代浏览器实现集成密码管理...因此,许多现代浏览器不支持登录字段的autocomplete =off...这是Firefox中的行为(自版本38以来) ),谷歌浏览器(自34以来)和Internet Explorer(自版本11以来)。

Modern browsers implement integrated password management ... For this reason, many modern browsers do not support autocomplete="off" for login fields ... This is the behavior in Firefox (since version 38), Google Chrome (since 34), and Internet Explorer (since version 11).



如果您正在编写用户管理页面,它会使生活稍微复杂一些。但遗憾的是,有太多人在登录表单上关闭了自动完成功能,试图阻止浏览器的内置密码管理器。这样做会使您的网站更少安全,因此浏览器开始忽略它。



不要试图让用户的生活更加艰难。让他们决定是否让他们的浏览器存储他们的凭据。没有正当理由阻止它。


It makes life slightly more complicated if you're writing a user management page. But unfortunately, too many people turned off autocomplete on login forms to try to block the browser's built-in password manager. Doing that makes your site less secure, so browsers started ignoring it.

Don't try to make life harder for your users. Let them make the decision of whether or not to let their browser store their credentials. There is no valid reason for you to block that.