4

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' />

3 Answers 3

1

Try using it like this:

<input autoComplete={'off'}>
Sign up to request clarification or add additional context in comments.

Comments

1

I found that I had to wrap all of my inputs in a <form> element. Empty was fine.

1 Comment

You are an angel! I've searched all over the internet for a solution. Have a great life!
0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.