简体   繁体   English

删除Chrome的自动填充弹出窗口

[英]Remove Chrome's AutoFill pop-up

When I fill a text input within Chrome (and maybe the same on FireFox and Internet Explorer) I have an AutoFill pop-up that is hiding my AutoComplete AJAX pop-up. 当我在Chrome中填充文本输入时(可能在FireFox和Internet Explorer中也是如此),我将看到一个自动填充弹出窗口,该弹出窗口隐藏了我的自动完成AJAX弹出窗口。 See photo below. 见下面的照片。

包含“ cann”的表单,Chrome自动填充与重叠的AJAX自动填充

I try to add autocomplete="off" but it didn't do anything and I learned that modern browser will not take these into account autocomplete="off" anymore. 我尝试添加autocomplete="off"但是它什么也没做,我了解到现代浏览器不再将这些因素考虑为autocomplete="off"了。

How can I forbid Chrome to pop-up this useless AutoFill div that simply hides my AJAX AutoComplete div? 如何禁止Chrome弹出仅隐藏AJAX自动完成div的无用AutoFill div?

my problem is the autofill popup, not the autocomplete feature ... 我的问题是自动填充弹出窗口,而不是自动完成功能...

The goal is to disable the chrome autocomplete popup when typing in my field named "Town / Zip Code* :", because I need to display my own ajax popup with a cities list. 目的是在输入名为“镇/邮政编码*:”的字段时禁用Chrome自动填充弹出窗口,因为我需要显示带有城市列表的自己的Ajax弹出窗口。

Here is a working solution, after many hours of search : 经过数小时的搜索,这是一个可行的解决方案:

<form method="post" action="">
<br/><label for="address">Address :</label><input type="text" id="address" name="address" value="">
<br/><label for="address2"></label><input type="text" id="address2" name="adress2" value="">
<br/><label for="code"><input style="display:none" />Town / Zip Code* :</label><input type="text" id="code" name="code" autocomplete="off" value="">
<div style="display:none"><br/><label for="city"></label><input type="hidden" id="city" name="city" value="0"></div>
<br/><label for="country">Country</label><select id="country" name="country"><option>France</option></select>
<br/><input type="submit" name="valider" value="ok">
</form>

Explanation : Chrome is parsing field names, field values, and labels preceding fields. 说明:Chrome正在解析字段名称,字段值和前面字段的标签。 If he detects that a word of "Adresses/Cities/Zipcodes" lexical field matches with your form, he enables the autocomplete and autofill popup for all the fields... 如果他检测到单词“ Adresses / Cities / Zipcodes”的词法字段与您的表单匹配,他将为所有字段启用自动完成和自动填充弹出窗口...

So I've renamed the input field and label with "code" instead of "zipcode", I've added " <input style="display:none" /> " before the zipcode label text, and it worked ! 因此,我用“代码”而不是“邮政编码”重命名了输入字段和标签,在邮政编码标签文本之前添加了“ <input style="display:none" /> ”,它可以正常工作! There is other solutions like removing labels, change input name/id, add <td> tags. 还有其他解决方案,例如删除标签,更改输入名称/ ID,添加<td>标签。

Hope it will help ! 希望对您有所帮助!

Simple. 简单。 To turn off Chrome's Autofill, go to Settings->Click on "Show Advanced Settings"->Find the Passwords and Forms section->Un-check the "Enable AutoFill to fill out web forms in a single click." 要关闭Chrome的自动填充功能,请依次转到设置->单击“显示高级设置”->查找密码和表单部分->取消选中“启用自动填充功能,只需单击一下即可填写网络表单”。 checkbox. 复选框。

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

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