【问题标题】:Chrome ugly message when autofill is disabled禁用自动填充时的 Chrome 丑陋消息
【发布时间】:2011-12-19 21:11:04
【问题描述】:

自从 Chrome 最近升级后,我开始看到消息“此网页已禁用此表单的自动填写”。当点击表单控件(确定,意外双击)时,我的网站上到处都是 autocomplete="off"(我们谈论的是聊天室等,其中浏览器确实不需要记住以前发送的消息)。

太丑了,有人知道怎么关闭吗?我在网上找不到太多信息,除了可以追溯到 2010 年的事情,只是说这是一项功能。问题是,我在最新版本上才刚刚开始发生这种情况,另一台运行 Chrome 的计算机也是如此。

有什么想法吗?

干杯

【问题讨论】:

  • 今天也注意到了这个问题...

标签: google-chrome autocomplete


【解决方案1】:

偶然发现了同样的问题并找到了一个简单的解决方法。

您必须将自动完成属性直接添加到输入字段而不是整个表单。

此代码有效:

<form method="get" action="index.php">
    <input type="text" name="q" autocomplete="off">

这不会

<form method="get" action="index.php" autocomplete="off">
    <input type="text" name="q">

【讨论】:

  • 也不起作用,因此请确保在添加到输入后不要在表单标记处留下自动完成功能。
  • 如果你在 jQuery 中构建一个小部件,你可以通过$('#input').prop('autocomplete',false);禁用它
  • 无法让它工作。但是我发现如果你有一个 谷歌仍然识别为用户字段并自动填充它。如果我将占位符更改为不包含“用户”一词,它会起作用。
【解决方案2】:

It Works for me :)
Guys you just need to add this code under the form tag, please check below:

<form>
<!-- fake fields are a workaround for chrome autofill getting the wrong fields-->
				<input type="text" name="fakeusernameremembered" style="display: none;" />
				<input type="password" name="fakepasswordremembered" style="display: none;" />
			<!--It helps me to remove the autofill in Chrome-->

..........

</form>

【讨论】:

    猜你喜欢
    • 2013-03-22
    • 2019-04-10
    • 2019-02-17
    • 2023-03-25
    相关资源
    最近更新 更多