You Autocomplete Me
Did you order something online this week? Did you sign into a social media account or create a new account? Chances are, if you interacted with web forms, you also clicked that dropdown to “Autofill” fields using your web browser.
I use autocomplete almost automatically. And when I use autocomplete online, I notice that there is about a 30% chance that something is filled in incorrectly. Normally the source of that error can be traced back to me — I still have several Chrome profiles with old addresses that need to be cleaned out. But occasionally, the error is not my fault. Case in point:
As awesome as it would be to have the name “Tristrum Tristrum”, my actual last name is “Tuttle.” No worries! I fixed the mistake manually and continued filling out the form.
After I made my account I totally forgot about this small site bug. Until later, when my fiancé and I went to get our COVID tests that we had signed up for using this very website. As we waited in line, person after person had to spend additional time correcting this mistake at the check-in desk before picking up their testing kit.
I went back to the site later and checked the html:
As it turns out, the “autocomplete” attribute on both inputs was the same. This was surprising to me because most autocomplete mistakes I see are from inputs that don’t have an autocomplete attribute. When an input doesn’t have an autocomplete attribute, the browser guesses how to fill in the field. In HTML5, the autocomplete attribute was expanded to specify exactly which field to use for autocompleting the input. In this case, it seems like the autocomplete value “given-name” is pulling in the first name from my Chrome address. I checked my Chrome addresses to see what the given names of my different addresses look like (Settings → Autofill → Addresses and more).
Interesting! Apparently, Chrome automatically guesses a first name (AKA “given-name”) from the Name field of the saved address. In that case, how does Chrome autofill my last name? Looking at the full list of autofill values, it seems like the “family-name” should correspond to my last name, generally.
Even though I had traced this bug back to the website itself, I was really curious about how Chrome responds to different autocomplete values, so I created a quick web form that has a text input for every single autocomplete value:
With my testing site online, I experimented with a few different Chrome addresses and profiles.
- For addresses that include my middle name, it seems like Chrome autofills “given-name” as Tristrum, my “additional-name” as my middle name, and “family-name” as Tuttle.
- For addresses that have more than three names, Chrome autofills “given-name” and “family-name” the same, and just passes all the remaining names in the middle into the “additional-name” input.
- Hyphenated names are treated the same as if they were a single name. So Tristrum Middle Name-Tuttle results in Tristrum (given) and Name-Tuttle (family) while Tristrum-Middle Name Tuttle results in Tristrum-Middle (given) and Tuttle (family).
- Honorific prefixes (Mr., Mrs., Dr., etc) and suffixes (IV, etc) are excluded from the given, additional and family names, but also do not autofill the honorific-prefix nor honorific-suffix inputs. The exception I found was honorific suffixes like “the Third” do get included in the various names, resulting in “Tristrum” (given) “Middle Name the” (additional) “Third” (family).
- The “name” autocomplete value always autocompletes the full name from the address.
In general Chrome does a decent job of autocompleting the different fields using a single Name from my saved address. However, there are clearly cases where Chrome’s default logic for converting a single name into multiple pieces falls short. Googling “chrome autofill first name incorrect” revealed multiple cases of this logic failing real users. It is also likely that this issue disproportionately impacts users from Spanish speaking countries where it is common to have multiple surnames.
If you are seeing mistakes when Chrome autofills your information, you can try changing your name in your Chrome profile (which does have a separate input for first and last name). Aside from this stop gap solution, I hope Chrome and other autocomplete sources allow for more customization of the specific values specified by the autocomplete documentation in the future. If one autocomplete bug in a single website can mildly inconvenience COVID testing for a city, then just imagine how bad autocomplete implementation in the most popular browser must be impacting anyone with multiple first or last names.
Thank you to my fiancé Monica for editing this article 🎉