Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autocomplete=cc-number but for 4 separate input boxes #9927

Open
saschanaz opened this issue Nov 13, 2023 · 3 comments
Open

autocomplete=cc-number but for 4 separate input boxes #9927

saschanaz opened this issue Nov 13, 2023 · 3 comments

Comments

@saschanaz
Copy link
Member

saschanaz commented Nov 13, 2023

What is the issue with the HTML Standard?

Currently we have autocomplete=cc-number to accommodate the need to autofill the credit card numbers. Per the examples this only considers the full-number-in-one-box use case:

Field name Meaning Canonical Format Canonical Format Example Control group
"cc-number" Code identifying the payment instrument (e.g. the credit card number) ASCII digits 4114360123456785 Text

In this example the page has explicitly specified the currency and amount of the transaction. The form requests a credit card and other billing details. The user agent could use this information to suggest a credit card that it knows has sufficient balance and that supports the relevant currency.

<form method=post action="step2.cgi">
 <input type=hidden autocomplete=transaction-currency value="CHF">
 <input type=hidden autocomplete=transaction-amount value="15.00">
 <p><label>Credit card number: <input type=text inputmode=numeric autocomplete=cc-number></label>
 <p><label>Expiry Date: <input type=month autocomplete=cc-exp></label>
 <p><input type=submit value="Continue...">
</form>

Meanwhile, it seems common for websites to have 4 separate input boxes for credit card numbers:

Lufthansa-Issue.2.mov

The case where there are 4 separate input boxes for card number

Firefox since 2022 started to support such use cases, i.e. it autofills each 4-digit when there are 4 boxes with autocomplete=cc-number, but this is not standardized and is not web compatible:

  • Chrome: It autofills the same full number for all boxes
  • Safari: The autofill happens only for the selected box

Can we get a standardized autofill feature to accommodate the need for separate boxes? Perhaps autocomplete=cc-number-N to be less hacky?

A relevant Mozilla bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1864395

@annevk
Copy link
Member

annevk commented Nov 28, 2023

Do we have a list of websites that use this pattern so we can compare browser behavior?

Also, if websites already use this pattern it seems like we should probably standardize on that, even though it's a bit finicky?

@saschanaz
Copy link
Member Author

Mozilla doesn't have a list of websites. I'll try adding a telemetry to get some use counter.

@tabatkins
Copy link
Collaborator

I find it's common on Japanese and Korean commerce sites (and possibly elsewhere in east asia, but those are where I've experienced it).

(I find it incredibly annoying and weird, particularly since not all CCs have the 4/4/4/4 digit grouping, but oh well. Accepting it as a standardized option would still help me so I didn't need to grab my CC on those sites.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants