admin管理员组文章数量:1312774
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 autoplete="off"
to all the inputs as well as the form, yet this prompt still es 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 autoplete="off"
, however Chrome no longer acknowledges autoplete="off"
.
This is the banner I'm referring to:
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 autoplete="off"
to all the inputs as well as the form, yet this prompt still es 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 autoplete="off"
, however Chrome no longer acknowledges autoplete="off"
.
This is the banner I'm referring to:
Share Improve this question edited May 23, 2017 at 12:22 CommunityBot 11 silver badge asked Mar 25, 2015 at 16:10 whatsnewsaeswhatsnewsaes 4252 gold badges5 silver badges13 bronze badges 6- Name the field to something else? – epascarello Commented Mar 25, 2015 at 16:17
- possible duplicate of Disable browser 'Save Password' functionality – bviale Commented Mar 25, 2015 at 16:19
- Already answered here : stackoverflow./questions/32369/… – bviale Commented Mar 25, 2015 at 16:19
- Also answered here stackoverflow./a/29582380/4462191 – camiblanch Commented May 6, 2015 at 16:09
- 7 All those answers relate to text box password fields and suggest setting autoplete="off" on the form. OP is asking about credit card info in Chrome on a form that already has autoplete="off". I am seeing the same behaviour and I agree with OP that Chrome is not acknowledging this and is offering autoplete 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 Commented Jun 5, 2015 at 15:28
4 Answers
Reset to default 3What 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.
I had the same problem you're experiencing; and with a newer browser version.
To resolve this, you have to set autoplete at form element.
<form autoplete="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 autoplete="off"
at <input type="text" />
for Credit Card prompts, but doesn't prompt when you set it with <form>
.
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>
There's a good reason why Chrome ignores autoplete="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 autoplete="off"
by setting the appropriate flag in chrome://flags
which would give you the oute you desire, but this only affects your browser - again, it's the user's information to decide to do with as they see fit.
本文标签: javascriptHow to prevent Chrome from requesting to save credit card informationStack Overflow
版权声明:本文标题:javascript - How to prevent Chrome from requesting to save credit card information - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741828553a2399792.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论