停止谷歌自动填充/自动完成破坏我的表单,禁用表单上的自动填充 [英] STOP Google Autofill/AutoComplete from ruining my form, Disable autofill on form

查看:41
本文介绍了停止谷歌自动填充/自动完成破坏我的表单,禁用表单上的自动填充的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有输入字段的表单:

I have a form with an input field:

<input id="postalCode" placeholder="Postal Code* (A0A 0A0)" autocomplete="off">

我在这里使用了我自己的自定义自动完成,谷歌自动填充覆盖并破坏了表单中的验证和用户体验.

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" 并且谷歌仍然通过验证或占位符推断字段类型.我试过 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:

禁用 Chrome 自动填充

没有任何效果.

推荐答案

好的,这对我有用:

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.

这篇关于停止谷歌自动填充/自动完成破坏我的表单,禁用表单上的自动填充的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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