Reputation: 41
I'm trying to use autoComplete attribute for credit card details on 's (not wrapped in any form) but it is not working.
Any guesses? Is https required for autocomplete to work?
I've tried the following using Safari and Chrome:
<input type='text' placeholder='xxxx xxxx xxxx xxxx' value={this.state.card} autoComplete='on' />
<input type='text' placeholder='xxxx xxxx xxxx xxxx' value={this.state.card} autoComplete='cc-number' />
Upvotes: 4
Views: 2570
Reputation: 819
I found that I had to wrap all of my inputs in a <form>
element. Empty was fine.
Upvotes: 1
Reputation: 41
Thanks for the answer. That didn't work for me.
I just figured out: Using name
and id
props with cc_number
value and of course, not running the project on localhost, works.
<input type='text' name='cc_number' id='cc_number' ... />
For the expiration month and year I used exp_month
and exp_year
.
Upvotes: 0