8

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 acknowledges autocomplete="off".

This is the banner I'm referring to:

Do you want chrome to save your credit card information

Community
  • 1
  • 1
whatsnewsaes
  • 405
  • 2
  • 5
  • 13
  • Name the field to something else? – epascarello Mar 25 '15 at 16:17
  • possible duplicate of [Disable browser 'Save Password' functionality](http://stackoverflow.com/questions/32369/disable-browser-save-password-functionality) – bviale Mar 25 '15 at 16:19
  • Already answered here : http://stackoverflow.com/questions/32369/disable-browser-save-password-functionality – bviale Mar 25 '15 at 16:19
  • Also answered here http://stackoverflow.com/a/29582380/4462191 – camiblanch May 06 '15 at 16:09
  • almost the same question : http://stackoverflow.com/questions/10938891/disable-autofill-in-chrome-without-disabling-autocomplete – gandra404 May 22 '15 at 09:44
  • 6
    All those answers relate to text box password fields and suggest setting autocomplete="off" on the form. OP is asking about credit card info in Chrome on a form that already has autocomplete="off". I am seeing the same behaviour and I agree with OP that Chrome is not acknowledging this and is offering autocomplete for credit card details even when the form specifies not to. The other questions don't resolve this as they suggest things that OP has already tried and has stated aren't working. – Robin French Jun 05 '15 at 15:28

4 Answers4

3

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.

Barsham
  • 749
  • 8
  • 30
1

I had the same problem you're experiencing; and with a newer browser version.

Save card prompt

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>.

Patrick W
  • 1,485
  • 4
  • 19
  • 27
0

I tried everything and had no success. The way I solved it, in the end, was actually to replace my label e.g. "Credit Card Number" with an image that contained the words "Credit Card Number", it worked a charm.

<div class="field">
   <div class="label">
      <img src="../images/cc-number.png">
   </div>
   <div class="value">
      <input type="text" name="ccnumber" id="ccnumber">
   </div>
</div>
Pearce
  • 320
  • 4
  • 10
-4

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.

James Dinsdale
  • 789
  • 8
  • 23
  • 8
    I 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. – WW. Sep 20 '16 at 22:59
  • Besides the tricks mentioned, perhaps you could permutate the fieldname (always attaching someRandomHash – Frank N Oct 25 '16 at 02:07
  • The 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. – fletchsod May 21 '20 at 14:07