Re: *Part* of address-line1, still use autocomplete as normal?

Hi John,

Thank you for your very helpful authoritative reply.

I was hoping that something along these lines would be the advice:
So, recognizing that it may not always work as you want, adding "address-line1" and "address-line2" will be the correct mark-up for conformance-sake, but it may also result in the end user needed to go back and "tweak" what the autocomplete autocompleted. Not perfect, but 'editing' content (essentially removing too much content here) remains easier than having to type in all of the data (for mobility impaired users) and/or remembering all of the data (for some cognitively impacted users).
It made sense to me that using a "best guess" autocomplete value ("address-line1", "address-line2") was likely to be the most valuable option for a form that doesn't fit the model well, allowing as you say the user to get *some* helpful content auto-added, leaving them only to edit what it wrong. Hopefully less typing and more help than not using autocomplete simply because the form does not properly fit.

I had assumed, particularly in the case of fields:

YOUR_STREET_NUMBER

YOUR_STREET_NAME

I should use "address-line1" for both due to it representing "32 Vassar Street" (in the HTML5 model  https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fe-autocomplete-address-line1), rather than "address-line1" and "address-line2"; but perhaps it is better to offer the wider breadth of content provided by "address-line1" and "address-line2" and let the user benefit from that "fuller menu" of data, rather than my assumption. But clearly, either is considerably more correct than not offering autocomplete at all, just because a form does not precisely fit.

Glad I asked, great to get this confirmation, thank you again.

Regards,

Alan

. . . . -   . . - - -
Alan Bristow ( he / him / il )
Web Developer / Développeur Web
Elections Canada / Élections Canada
alan.bristow@elections.ca<mailto:alan.bristow@elections.ca>
________________________________
From: John Foliot <john@foliot.ca>
Sent: 07 June 2023 15:27
To: Bristow, Alan <Alan.Bristow@elections.ca>
Cc: w3c-wai-ig@w3.org <w3c-wai-ig@w3.org>
Subject: Re: *Part* of address-line1, still use autocomplete as normal?

Ce message a été envoyé par un expéditeur externe. Veuillez faire preuve de prudence et ne pas cliquer sur les liens ou ouvrir les pièces jointes à moins de reconnaître l'expéditeur et de savoir que le contenu est sûr.

This message was sent from an external sender. Please exercise caution and do not click links or open attachments unless you recognize the sender and know the content is safe.


Hi Alan,

A quick check of the HTML5 spec (https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofilling-form-controls:-the-autocomplete-attribute) and I note that there is both a field identifier of "street-address" as well as "address-line1", "address-line2", and "address-line3". When SC 1.3.5 was 'in flight' I created the following test suite to verify browser behavior of those values. The Test suite starts here: https://john.foliot.ca/demos/autofill.php


As I recall, the fields of address-line (1 through 3) are somewhat dependent on how the user has stored the data in their browser. Consider the following screenshot:
[image.png]
(source: Vivaldi browser on Win 11)

As I do not work for any of the browsers vendors, I cannot say for sure in all instances, but my quick testing seems to confirm that the line break is dependant on how the data is stored on the browser. However, because this IS a user-feature, all browsers allow the user to modify or update their saved address data (see this Mozilla article for Firefox: https://support.mozilla.org/en-US/kb/automatically-fill-your-address-web-forms?as=u&utm_source=inproduct&redirectslug=automatically-fill-your-address-and-credit-card&redirectlocale=en-US)

However, specific to your question, I suspect that if you label both inputs with the same autocomplete value, both inputs will be 'autofilled' with the same (identical) data - because the output is directly related to HOW the data is stored in the browser:

[image.png]
(screenshot showing the autofill data  setting from Firefox, along with a snippet of the output results from my test suite)

So, NO, I do not think "address-line1" on two inputs will give you the results you seek, that you will instead get the identical values twice. I'd advise (without testing) to try and use "address-line1" and "address-line2" and test extensively. (NOTE: autocomplete is intended to be a 'service' to the end user, and not all users will have their addresses saved. So, recognizing that it may not always work as you want, adding "address-line1" and "address-line2" will be the correct mark-up for conformance-sake, but it may also result in the end user needed to go back and "tweak" what the autocomplete autocompleted. Not perfect, but 'editing' content (essentially removing too much content here) remains easier than having to type in all of the data (for mobility impaired users) and/or remembering all of the data (for some cognitively impacted users).

HTH

JF

On Wed, Jun 7, 2023 at 11:24 AM Bristow, Alan <Alan.Bristow@elections.ca<mailto:Alan.Bristow@elections.ca>> wrote:
Any comments appreciated re the following.

SUMMARY
If I have *two* INPUTS representing line 1 of an address, one for the number of a street and the other for its name, should both have an "autocomplete" attribute set to "address-line1"?


DETAIL
I am working with a legacy app that for the foreseeable future captures address info in a form where the fields include approximately:

YOUR_STREET_NUMBER

YOUR_STREET_NAME

I want to tell my developers that since they need to follow "SC 1.3.5: Identify Input Purpose" [1] they need to use "autocomplete" on both INPUTS. However, while it is clear they should use "address-line1" [2] if there was *one* field capturing an address line such as "42 Ultimate Street", I am uncertain if it is still correct to use when there are two fields each holding only part of "line 1".

I assume it *is* correct and hope current or future user-agents will work out what to do with the meta provided, but not being sure I thought I should ask here.

[1] https://www.w3.org/WAI/WCAG22/Understanding/identify-input-purpose.html

[2] https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofilling-form-controls:-the-autocomplete-attribute:attr-fe-autocomplete-address-line1


Regards,

Alan

. . . . -   . . - - -
Alan Bristow ( he / him / il )
Web Developer / Développeur Web
Elections Canada / Élections Canada
alan.bristow@elections.ca<mailto:alan.bristow@elections.ca>


--
John Foliot |
Senior Industry Specialist, Digital Accessibility |
W3C Accessibility Standards Contributor |

"I made this so long because I did not have time to make it shorter." - Pascal "links go places, buttons do things"

Received on Thursday, 8 June 2023 11:31:55 UTC