Skip to content
This repository was archived by the owner on Aug 26, 2025. It is now read-only.

Credit Card Autocomplete Recommendations

Ellegonzalez edited this page Nov 19, 2016 · 2 revisions

We recommend you turn autocomplete on for credit card forms, except for the CVC field. You can do this by setting the autocomplete attribute:

<form autocomplete="on">
  <input class="cc-number">
  <input class="cc-cvc" autocomplete="off">
</form>

You should also mark up your fields using the Autocomplete Types spec. These are respected by a number of browsers, including Chrome.

<input type="text" class="cc-number" pattern="\d*" autocompletetype="cc-number" placeholder="Card number" required>

Set autocompletetype to cc-number for credit card numbers, cc-exp for Credit Card expiry and cc-csc for the CVC (security code).

Clone this wiki locally