问题
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