简体   繁体   English

自动完成=“禁用”和自动完成=“关闭”之间的区别

[英]Difference between autocomplete = "disabled" and autocomplete = "off"

What is the difference between autocomplete = "disabled" and autocomplete = "off", when I use autocomplete = "off", I'm still able to get a drop down and able to fill emails. autocomplete = "disabled" 和 autocomplete = "off" 有什么区别,当我使用 autocomplete = "off" 时,我仍然能够获得下拉菜单并能够填写电子邮件。 I'm using edge, below are screenshots for reference我用的是edge,下面是截图供参考

自动完成=“关闭”

自动完成=“禁用”

Yeah, getting autocomplete to turn off is difficult.是的,要关闭自动完成功能很困难。 I have not found a solution to this.我还没有找到解决方案。 I'm not sure why google has to be a pain in the rear about things like this.我不确定为什么谷歌必须对这样的事情感到痛苦。 I just read a blog from 12/18/21 AD where some guy was explaining how to turn autocomplete on.我刚刚阅读了 12/18/21 AD 的一篇博客,其中有人在解释如何打开自动完成功能。 I believe it's on by default.我相信它是默认开启的。 Turning it off will take some hacking.关闭它需要一些黑客攻击。

So the problem is that autocomplete="off" is largely ignored in modern browsers - primarily due to password managers etc.. In your case autocomplete="disabled" is working because your browser doesn't recognize this value.所以问题是autocomplete="off"在现代浏览器中很大程度上被忽略了 - 主要是由于密码管理器等。在你的情况下autocomplete="disabled"正在工作,因为你的浏览器无法识别这个值。 So you may be happy that random value works for you as this solution sometimes doesn't work either.所以你可能会很高兴随机值对你有用,因为这个解决方案有时也不起作用。

Here are some other solutions to this problem: https://stackoverflow.com/questions/12374442/chrome-ignores-autocomplete-off"以下是此问题的一些其他解决方案: https://stackoverflow.com/questions/12374442/chrome-ignores-autocomplete-off"

It is form attribute autocomplete="off" and autocomplete="false" for input field disabled禁用输入字段的表单属性 autocomplete="off" 和 autocomplete="false"

 <form autocomplete="off"> <input id="email" autocomplete="false" name="email" type="email"> </form>

disabling the autofill with jQuery使用 jQuery 禁用自动填充

 <body> <form id="login-form"> <label for="fname">First Name:</label> <input type="text" id="fname" name="fname"/> <label for="email">Email:</label> <input type="text" id="email" autocomplete="false" name="email"> </form> <script> $(function() { $('#login-form').disableAutoFill(); }); </script> </body>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM