自动完成关闭VS假的? [英] Autocomplete off vs false?

查看:146
本文介绍了自动完成关闭VS假的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,我所遇到的,我想禁用自动完成所有的浏览器的问题。

Recently I have come across an issue where I wanted to disable auto-complete in all browsers.

浏览器在设置的新功能,您可以添加一个卡号。而且要求是同时禁用。

Chrome has a new feature in settings where you can add a card number. And the requirement was to also disable that.

什么在所有浏览器的工作就是做这个自动完成=在形式层面假的。

What worked in all browsers was to do this autocomplete=false at form level.

但是,这并不符合W3的规则,他们执行有自动完成=关闭|。在

But this is not compliant with w3 rules, where they enforce to have autocomplete=off|on.

有人能向我解释为什么在所有的浏览器错误的作品?

甚至IE8,所有的Firefox和Safari等,但不符合。

even ie8, all firefox, safari etc. But is not compliant.

推荐答案

您是对的。设置自动完成属性设置为关闭并不在较新版本的Chrome浏览器禁用自动填充。

You are right. Setting the autocomplete attribute to "off" does not disable Chrome autofill in more recent versions of Chrome.

不过,可以开或关(假,真,NOFILL)设置自动完成任何事情,除了它会禁用Chrome自动填入。

However, you can set autocomplete to anything besides "on" or "off" ("false", "true", "nofill") and it will disable Chrome autofill.

此行​​为可能是因为autocomplete属性既期待开或关的价值,如果你给它别的什么都不做。所以,如果你给它比其他价值观的东西,自动填充分崩离析/不会做任何事情。

This behavior is probably because the autocomplete attribute expects either an "on" or "off" value and doesn't do anything if you give it something else. So if you give it something other than those values, autofill falls apart/doesn't do anything.

有了Chrome的当前版本已经发现,设置自动完成属性设置为OFF实际工作了。

另外,我还发现,如果你设置在每个autocomplete属性这仅适用<输入方式> 形式的标签

Also, I have found that this only works if you set the autocomplete attribute in each <input> tag of the form.

有一直以这种模糊性在铬的bug列表的这里

There has been a response to this ambiguity in the Chromium bug listings here.

免责声明:本被发现在Chrome浏览器版本是真实的47.0.2526.106(64位)

Disclaimer: This was found to be true in Chrome version 47.0.2526.106 (64-bit)

这篇关于自动完成关闭VS假的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆