1

I'm developing a simple point-of-sale web app, and part of that is there is a credit card field. This field is for entering a customer's credit card, and therefore the number should neither

a) be saved by the browser, or

b) or be loaded from the local computer.

The app is used for my reps to enter credit card info on behalf of a customer who they are ringing up.

I can tell them not to save the card but it would be best to disable the feature. I've seen a number of posts about this but it seems they are either outdated or slightly different use cases.

This is the HTML for my field -

<input autocomplete="off" class="form-control" id="creditcard" placeholder="Credit card number" type="text">
metahamza
  • 1,405
  • 10
  • 26
  • 1
    You can add an autocomplete="off" attribute on the form. – user2182349 Jun 02 '15 at 22:35
  • @user2182349 - thanks for the reply. I've tried this and to no avail. Perhaps Safari handles credit card autocompletion in a different fashion than other kinds. – metahamza Jun 03 '15 at 00:43

2 Answers2

0

You Can Use autocomplete Attribute And Set Its Value To off .. like this:

<input type="text" id="creditCard" autocomplete="off" />
0

One approach that can be used is to use a unique id/name for the input, unfortunately this makes the form processing more complex because the server must remember what name/id was sent.

However, it should prevent the browser from reusing entered data.

user2182349
  • 9,569
  • 3
  • 29
  • 41
  • Believe it or not, I've tried this approach as well. It seems that Safari picks up the pattern even from the `placeholder` attribute. I tried with this `` and it still triggers the credit card autocompletion stuff. – metahamza Jun 03 '15 at 16:29