Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Safari autofill Credit Card

I am trying to use the code below to use "Safari's AutoFill" of the credit card. But it did not work

<input type="text" autocomplete="cc-number">
<input type="text" autocomplete="cc-name">
<input type="text" autocomplete="cc-exp-month">
<input type="text" autocomplete="cc-exp-year">
<input type="text" autocomplete="cc-csc">
like image 915
Claytinho Avatar asked Feb 19 '14 15:02

Claytinho


People also ask

How do I fix AutoFill credit card on iPhone?

To edit or delete any saved credit card, go to Settings > Safari > AutoFill > Saved Credit Cards, and tap the card you want to edit or delete. Tap Edit and then tap Delete Credit Card or change the credit card information. Tap Done.


2 Answers

To make it work you need to:

  • Use any of this names: addCreditCardNumber, cardNumber, cardnumber -or- any of this ids: cardNumber, creditCardNumber, creditCardMonth, creditCardYear (there may be more ids or names that works)
  • Use an input with text type (not number type)
  • And most importantly it will only work over https

Hope this helps!

like image 195
Alejandro Garcia del Rio Avatar answered Oct 06 '22 00:10

Alejandro Garcia del Rio


I solved by using this ids:

<input type="text" id="cardNumber">
<input type="text" id="cardHolder">
<input type="text" id="cardExpirationMonth">
<input type="text" id="cardExpirationYear">
<input type="text" id="cardCsc">
like image 22
Claytinho Avatar answered Oct 05 '22 23:10

Claytinho