在政府医疗机构工作的乐趣之一是必须处理所有围绕PHI(受保护的健康信息)的偏执。不要误解我的意思,我支持尽一切可能保护人们的个人信息(健康状况、财务状况、上网习惯等),但有时人们会有点太神经质了。

举个例子:我们的一位州客户最近发现浏览器提供了保存密码的方便功能。我们都知道它已经存在了一段时间,完全是可选的,由最终用户决定是否使用它是一个明智的决定。然而,目前有一点骚动,我们被要求找到一种方法来禁用我们网站的功能。

问:网站有没有办法告诉浏览器不要提供记住密码的功能?我从事网络开发已经很长时间了,但我不知道我以前遇到过这种情况。

任何帮助都是感激的。


当前回答

好吧,这是一个非常老的帖子,但我仍然会给出我的解决方案,这是我的团队长期以来一直在努力实现的。我们只是在表单中添加了一个新的input type="password"字段,并将其包装在div中,并使div隐藏起来。确保这个div在实际的密码输入之前。 这为我们工作,它没有提供任何保存密码选项

扑通- http://plnkr.co/edit/xmBR31NQMUgUhYHBiZSg?p=preview

HTML:

<form method="post" action="yoururl">
      <div class="hidden">
        <input type="password"/>
      </div>
      <input type="text" name="username" placeholder="username"/>
      <input type="password" name="password" placeholder="password"/>
    </form>

CSS:

.hidden {display:none;}

其他回答

除了

autocomplete="off"

使用

readonly onfocus="this.removeAttribute('readonly');"

对于您不希望他们记住的输入表单数据(用户名,密码等),如下所示:

<input type="text" name="UserName" autocomplete="off" readonly 
    onfocus="this.removeAttribute('readonly');" >

<input type="password" name="Password" autocomplete="off" readonly 
    onfocus="this.removeAttribute('readonly');" >

在最新版本的主流浏览器(如谷歌Chrome, Mozilla Firefox, Microsoft Edge等)上进行了测试,效果非常好。

就像人们意识到的那样——“自动完成”属性在大多数时候都是有效的,但高级用户可以使用bookmarklet绕过它。

使用浏览器保存密码实际上可以增加对键盘记录的保护,所以最安全的选择可能是将密码保存在浏览器中,但使用主密码保护它们(至少在Firefox中是这样)。

我周围有个工作,可能会有帮助。

你可以自定义字体。所以,做一个自定义字体,所有的字符为点/圆/星号为例。使用它作为你网站的自定义字体。检查如何做到这一点在inkscape:如何使自己的字体

然后在你的登录表单上使用:

<form autocomplete='off'  ...>
   <input type="text" name="email" ...>
   <input type="text" name="password" class="password" autocomplete='off' ...>
   <input type=submit>
</form>

然后添加css:

@font-face {
    font-family: 'myCustomfont';
    src: url('myCustomfont.eot');
    src: url('myCustomfont?#iefix') format('embedded-opentype'),
         url('myCustomfont.woff') format('woff'),
         url('myCustomfont.ttf') format('truetype'),
         url('myCustomfont.svg#myCustomfont') format('svg');
    font-weight: normal;
    font-style: normal;

}
.password {
  font-family:'myCustomfont';
}

很好的跨浏览器兼容性。我尝试过IE6+、FF、Safari和Chrome浏览器。只要确保你转换的oet字体不会被损坏。希望有帮助?

我认为加上autocomplete="off"一点用都没有

我有另一个解,

<input type="text" name="preventAutoPass" id="preventAutoPass" style="display:none" />

在输入密码之前添加此选项。

例如:<input type=“text” name=“txtUserName” id=“txtUserName” /> <输入类型=“文本” 名称=“防止自动传递” id=“防止自动传递” 样式=“显示:无” /> <输入类型=“密码” 名称=“txtPass” id=“txtPass” autocomplete=“off” />

这并不会阻止浏览器询问并保存密码。但它阻止了密码的填写。

欢呼

如果autocomplete="off"不起作用…删除表单标签并使用div标签,然后使用jquery将表单值传递给服务器。这对我很管用。