Autofilling Credit Cards Ignores input[type=tel]

I'm building a checkout form and was testing 1Password's Credit Card autofill, but it was only filling in the name. I narrowed it down to the fact that I'm using input[type=tel] for the credit card number, expiration, and verification code. If I change these fields to input[type=text] then 1Password fills them just fine. Would it be possible to get tel inputs to behave similarly to text inputs?

You may be wondering why I'm using tel for things which are clearly not telephone numbers. I'd like to use input[type=number] for the fields, but most browsers interpret that is an integer (i.e., no leading zeros). Obviously credit cards details can have leading zeros and there's no accounting for what a customer chooses to input. The tel input is interesting because it allows leading zeros, but it still brings up the numpad on mobile devices. This way a user has big, fat number buttons to press and can still add leading zeros.

Even though this tel trick is a hack that I would rather avoid, I'd love to see 1Password honor input fields' names/ids/classes regardless of their type.


Thanks,
Adam

Comments

  • khad
    khad
    1Password Alumni
    Thanks so much for posting about this, Adam. We were just talking with one of the Stripe folks earlier. It appears their default template uses type=tel which, while not semantically correct (as you mention) is a very nice hack on mobile devices. I will certainly pass this along to the developers. :)

    If we can be of further assistance in the meantime, please let us know. We are always here to help!

    (Just out of curiosity, are you using Stripe?)
  • Awesome. Stripe is great, and yes, I'm using them. :)
  • khad
    khad
    1Password Alumni
    Cool. Not sure if Stripe will be updating their templates, but I've added this thread to our internal information on this.
This discussion has been closed.