I was hoping to tie our site in with Chrome's Address Autofill, but I can't find any reference for how it expects the forms to be presented.
I'm guessing it's looking for something pretty specific in the name= fields of the forms, but a good reference would be nice, instead of having to reverse engineer it.
At the moment, Chrome fills none of our forms, but Safari fills most of them. At the risk of asking two questions at once: anyone got a reference for safari as well? Safari seems to be using our title= fields...
It doesn't use this standard, does it? http://www.ietf.org/rfc/rfc3106.txt
Open Chrome . Select the three-dot menu on the top right of your screen. Select Settings . Under Autofill, select Payment methods . Toggle on Save and fill payment methods . Select the back arrow to go back to Settings. Select Addresses and more . Toggle on Save and fill addresses.
Autofill can be used to save passwords, payment details, addresses, and other forms of contact details. You can access these settings by clicking the three-dot menu icon in the top-right corner of the Chrome window.
How to Enable AutoComplete on your HTML forms. Here are some key points on how to enable autocomplete: Use a <label> for all your <input> fields. Add a autocomplete attribute to your <input> tags and fill it in using this guide. Name your name and autocomplete attributes correctly for all <input> tags.
Some web pages will be written in such a way that some fields that look the same to you and I are not, under the hood. So the browser may offer to auto-fill what appears to be the same types of field only sometimes. Or not at all.
This question is pretty old but I have an updated answer for 2017!
There is now full documentation on how to trigger autocomplete.
Here's a link to the official current WHATWG HTML Standard for enabling autocomplete.
The following answer is from my original answer from here: https://stackoverflow.com/a/41965106/1696153
Google wrote a pretty nice guide for developing web applications that are friendly for mobile devices. They have a section on how to name the inputs on forms to easily use auto-fill. Eventhough it's written for mobile, this applies for both desktop and mobile!
Here are some key points on how to enable autocomplete:
<label>
for all your <input>
fieldsautocomplete
attribute to your <input>
tags and fill it in using this guide.name
and autocomplete
attributes correctly for all <input>
tagsExample:
<label for="frmNameA">Name</label>
<input type="text" name="name" id="frmNameA"
placeholder="Full name" required autocomplete="name">
<label for="frmEmailA">Email</label>
<input type="email" name="email" id="frmEmailA"
placeholder="[email protected]" required autocomplete="email">
<!-- note that "emailC" will not be autocompleted -->
<label for="frmEmailC">Confirm Email</label>
<input type="email" name="emailC" id="frmEmailC"
placeholder="[email protected]" required autocomplete="email">
<label for="frmPhoneNumA">Phone</label>
<input type="tel" name="phone" id="frmPhoneNumA"
placeholder="+1-555-555-1212" required autocomplete="tel">
<input>
tagsIn order to trigger autocomplete, make sure you correctly name the name
and autocomplete
attributes in your <input>
tags. This will automatically allow for autocomplete on forms. Make sure also to have a <label>
! This information can also be found here.
Here's how to name your inputs:
name
: name fname mname lname
autocomplete
:
name
(for full name)given-name
(for first name)additional-name
(for middle name)family-name
(for last name)<input type="text" name="fname" autocomplete="given-name">
name
: email
autocomplete
: email
<input type="text" name="email" autocomplete="email">
name
: address city region province state zip zip2 postal country
autocomplete
:
street-address
address-line1
address-line2
address-level1
(state or province)address-level2
(city)postal-code
(zip code)country
name
: phone mobile country-code area-code exchange suffix ext
autocomplete
: tel
name
: ccname cardnumber cvc ccmonth ccyear exp-date card-type
autocomplete
:
cc-name
cc-number
cc-csc
cc-exp-month
cc-exp-year
cc-exp
cc-type
name
: username
autocomplete
: username
name
: password
autocomplete
:
current-password
(for sign-in forms)new-password
(for sign-up and password-change forms)There are a bunch of stuff that could be "expected" (like things in RFC3106 or the hCard format) but in the end it comes down to what you can find in the Chromium source code, I guess.
This specific section which seems to be Chromium's AutoFill implementation is probably of interest for you, which I found by using the Google Code Search feature for Chromium now available via Google Code Project Hosting.
Some of the constants are extern-ed used for regular expressions are defined in autofill_regex_constants.h
and provided in a fairly extensive list (even with I18N support!) in autofill_regex_constants.cc.utf8
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With