How to prevent Chrome from requesting to save credit card information
Solution 1
There's a good reason why Chrome ignores autocomplete="off"
- it's not your information to decide whether or not the user's browser can save it. As such there is deliberately no way to disable this functionality programmatically.
You can make Chrome respect autocomplete="off"
by setting the appropriate flag in chrome://flags
which would give you the outcome you desire, but this only affects your browser - again, it's the user's information to decide to do with as they see fit.
Solution 2
What I did is using a hidden field for Credit Card Number and Save the actual credit card number in it then clear the actual Credit Card number from screen by JScript.
Solution 3
I had the same problem you're experiencing; and with a newer browser version.
To resolve this, you have to set autocomplete at form element.
<form autocomplete="off" action="/cc.html" method="POST">
<!-- Form fields -->
<input type="text" name="cc" id="cc" />
<!-- More form fields -->
</form>
For some reason Google Chrome ignores the autocomplete="off"
at <input type="text" />
for Credit Card prompts, but doesn't prompt when you set it with <form>
.
whatsnewsaes
Updated on June 15, 2022Comments
-
whatsnewsaes about 2 years
I am trying to find a way to programmatically disable Chrome's "Do you want save this credit card info" prompt.
I have tried adding
autocomplete="off"
to all the inputs as well as the form, yet this prompt still comes up.Is there a way to disable this programmatically?
Unfortunately, this is different from Disable browser 'Save Password' functionality because this all revolves around tricking Chrome into thinking the input field is not a password field / simply using
autocomplete="off"
, however Chrome no longer acknowledgesautocomplete="off"
.This is the banner I'm referring to:
-
E_the_Shy almost 8 yearsI disagree. I know my web page is asking a merchant for someone else's credit card number. Chrome tries to auto-fill the current user's credit card number. Which is useless and wrong. I don't expect my users to have to mess around in chrome://flags.
-
Frank Nocke over 7 yearsBesides the tricks mentioned, perhaps you could permutate the fieldname (always attaching someRandomHash <input name="cardno5aCvG... <input name="cardno8FHV48... - filtering (normalizing) that when processing the returned form values (there'll always be just one (cardno.*)-value in the form, easily regExp-able...)
-
fletchsod about 4 yearsThe problem is we had to comply with merchant's security requirement due to multiplying security breach by hackers in web browsers. So it is a must. Also we have a dealer that know every customer's credit card info which is a violation of merchant's security rule too.
-
k3davis almost 3 yearsThis answer trades one problem for another (accessibility), imho.