Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

autocomplete attribute not working

I would like to enable browser's autofill option by using the autocomplete attribute.

According to https://html.spec.whatwg.org/multipage/forms.html#autofill

<input autocomplete="given-name">
<input autocomplete="family-name">
<input autocomplete="address-line1">

The given-name and family-name should autofill the first and last name (western culture). I can get this to work if I add another field on the form for the address line. However, the form on my website does not have an address field, only first and last name.

This works, but I cannot use: https://jsfiddle.net/gt6m1bgj/5/

This does not work, and I need it to: https://jsfiddle.net/em8p92sb/1/

Any ideas?

like image 676
Justin Williams Avatar asked Apr 20 '26 22:04

Justin Williams


1 Answers

Both your cases are working for me in Chrome 51 (OSX) And Safari 9.1.1

I had a quick look to see if I could find a chrome bug that had been resolved since your question, but quickly gave up on that :)

Another useful reference is: https://developers.google.com/web/updates/2015/06/checkout-faster-with-autofill?hl=en

like image 193
ptim Avatar answered Apr 23 '26 15:04

ptim



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!