Disable Chrome Autofill creditcard

这一生的挚爱 提交于 2020-05-27 04:33:06

问题


I have two fields in my form which Chrome falsely identified as credit card numbers (one is for a phone number and one is for a fax number). There are also two fields for firstnames which Chrome thinks are fields for credit card names and want to autofill. Is there some attribute I can use on these elements to tell Chrome that they are in fact not related to a credit card?

I've tried setting autocomplete="false" on the inputs. This removed the autofill options for address/contact information, but the credit card option was still there.


回答1:


I finally found a workaround! set the autocomplete attribute as "cc-csc" that value is the CVC of a credit card and that they are no allowed to store it! (for now...)

autocomplete="cc-csc"




回答2:


Have you tried:

autocomplete="nope"

At first glance this may look silly but ...

In some cases, the browser will keep suggesting autocompletion values even if the autocomplete attribute is set to off. This unexpected behavior can be quite puzzling for developers. The trick to really forcing the no-autocompletion is to assign a random string to the attribute --- https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion



来源:https://stackoverflow.com/questions/37595141/disable-chrome-autofill-creditcard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!