阻止Google自动填充/自动填充破坏我的表单,在表单上禁用自动填充 [英] STOP Google Autofill/AutoComplete from ruining my form, Disable autofill on form
问题描述
我有一个带有输入字段的表单:
I have a form with an input field:
<input id="postalCode" placeholder="Postal Code* (A0A 0A0)" autocomplete="off">
我在这里使用自己的自定义自动填充功能,该功能会自动填充Google封面,并破坏我表单中的验证和用户体验.
I was using my own custom autocomplete here which google autofill COVERS and ruins the validation and user experience in my form.
我尝试将ID更改为随机id ="ASDf",但Google仍然通过验证或占位符来推断字段类型.我已经尝试过autocomplete ="off"和"false".也不做任何事.在此页面上:
I have tried changing the id to something random id="ASDf" and still google infers the field type by the validation or placeholder. I have tried the autocomplete="off" and "false". Neither do anything. On this page:
https://www.canadapost.ca/cpotools/apps/fpc/personal/findAnAddress?execution = e1s1
他们已经成功地以某种方式禁用了它.
They have successfully disabled it somehow.
我已经尝试了此页面上的所有内容:
I have tried everything from this page:
没有任何效果.
推荐答案
好,这对我有用:
role="presentation" autocomplete="nope"
在Chrome版本64.0.3282.186(正式版)(64位)上进行了测试.
tested on Chrome Version 64.0.3282.186 (Official Build) (64-bit).
我必须将这两个都添加到每个有问题的输入中.我还添加了表单标签.对于此特定版本的Chrome,自动填充功能已禁用.我将其保留在此处,因为这确实很痛苦,其他帖子中的所有前期解决方案均无效.
I had to add both of those to each input in question. I also added to the form tag. For this specific version of Chrome the autofill is disabled. I am leaving this here because this is a real pain and ALL the up front solutions in other posts DO NOT work.
这篇关于阻止Google自动填充/自动填充破坏我的表单,在表单上禁用自动填充的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!