4

On the Payment page, we have text field for Credit card number. When the field is selected on android phone through chrome browser, it brings up "Scan new card". How to prevent this pop up? Any idea?

Xan
  • 74,770
  • 16
  • 179
  • 206
user472269
  • 367
  • 1
  • 4
  • 19
  • 1
    Change the html attributes of the field if it's your site. Or prevent javascript event listeners, otherwise. Anyway, the question lacks context. – wOxxOm Aug 23 '16 at 05:17
  • @wOxxOm, I changed the html id and name attributes to 'abc', since the associated label is 'Credit Card Number', it enable the option automatically. Only way to disable, If i change my label & text field to not matching pattern of string 'Credit Card Number'. Basically looking if there is any attribute to control enable/disable. – user472269 Aug 23 '16 at 16:36
  • @coder sorry for threadjacking - how did you manage to get scan new card? We can't trigger it for some reason: http://stackoverflow.com/questions/38899426/mobile-chrome-wont-offer-to-scan-credit-card – srgb Sep 20 '16 at 15:10
  • @srgb, replied on your original post – user472269 Sep 22 '16 at 00:10

3 Answers3

2

In my situation I changed the name of the field, the label of the field, the id of the field, added autocorrect="none" autocomplete="none" and change the name of my onblur function from "validateCCNumber" to something that did not have ccnumber in it.

Tom Hanson
  • 873
  • 10
  • 39
1

The chrome read each field attributes and properties. Name, ID, placeholder. When I removed "card" from placeholder it automatically disabled this option of asking to scan new card. instead it started showing saved mobile numbers when I added "phone".

Simply changed the placeholder of the field and no pop up anymore.

coder9090
  • 63
  • 9
-1

You might be able to hide this by adding the "autocomplete" attribute in your input tag and setting it to off. You could also set the autocorrect to off.

<input type="text" inputmode="numeric" pattern="[0-9]*" autocorrect="off" autocomplete="off">
John Conde
  • 217,595
  • 99
  • 455
  • 496
Jesper Wilfing
  • 11,157
  • 5
  • 29
  • 32