Prefill credit card information on web forms in iOS

- Posted in Uncategorized

Wouldn’t it be nice if you can prefill credit card information when filling out forms on the web? Well, in iOS, you can.

Make sure Safari > Settings > Autofill > Credit card is turned on. This setting will allow you to add a credit card by taking a photo of it or manually adding the data.

When the setting is on, if you go to a form on the web, provided it is served through a secure connection (SSL), and it has the correct references, Safari will offer to autofill the credit card information.

I presume developers of native apps will also be able to prompt the user for their credit card information using Apple’s provided API’s.

The trick to making it work on the web is using certain “name” attributes on the inputs e.g. “ccName”. I haven’t personally verified the pattern that Safari is matching to, but this code sample of a form should help you on your way.

Leave a Reply

Your email address will not be published. Required fields are marked *