ashanbrown
ashanbrown

Reputation: 747

how to get safari to autofill a credit card expiration date month/year select tag?

I have a form with select tags labeled autocomplete='cc-exp-month' and autocomplete='cc-exp-year'. Chrome will autofill them fine but safari does not fill them. Both chrome and safari fill in the input on the same form labeled autocomplete='cc-number'. Changing tag autocomplete tag to the more general 'cc-exp' didn't seem to help in Safari on either field. Does anyone know how to get Safari to fill out the month and year of the expiration date?

Upvotes: 3

Views: 2291

Answers (1)

ball-tongue
ball-tongue

Reputation: 26

For the element that you want to autocomplete, give it the attribute autocomplete="on". Be cautious with this; it's convenient, but as Alex K. said, not a good idea. Before you start dealing with peoples' information, please take the time to learn about security and at least the most common vulnerabilities. Here's a page explaining the risks of autocomplete.

https://www.hackavoid.com/news/2-why-you-should-avoid-autocomplete-on-login-forms

and hackthissite.org is awesome if you're interested in learning how vulnerabilities are exploited.

Best O' luck, I hope this helped.

Upvotes: 0

Related Questions