E-mail List Archives
Re: Form fields in a sentence
From: glen walker
Date: Sep 7, 2023 12:02PM
- Next message: Birkir R. Gunnarsson: "Re: Form fields in a sentence"
- Previous message: Nick Bromley: "Re: Providing accessible names with
" - Next message in Thread: Birkir R. Gunnarsson: "Re: Form fields in a sentence"
- Previous message in Thread: Patrick H. Lauke: "Re: Form fields in a sentence"
- View all messages in this Thread
>
> Could the intervening text, "My favourite country is" and "and favourite
> sport is", be given aria-hidden="true", leaving just the two fields exposed
> to AT? Would there be any downside to doing this? Or is it important that
> the visible text is exposed? Or alternatively, should just "My", "is",
> "and", and "is" have aria-hidden so that the text labels exposed to AT are
> identical to the field names?
>
All four of those questions are "it depends". We don't have the context of
what you're actually trying to convey. It might be important for the user
to know they are filling in fields within a sentence (kind of a "mad libs"
type of input, https://en.wikipedia.org/wiki/Mad_Libs) or it might not
matter and just knowing there's an input field with a label is sufficient.
> Another question is, if I make "favourite country" and "favourite sport"
> bold to support voice activation users, would that pass WCAG SC 2.5.3 Label
> in Name in your opinion?
>
If "favourite <whatever>" is bold, implying that it's the label for the
field, then as long as "favourite <whatever>" is in the accessible name, it
passes 2.5.3. You can have other stuff in the accessible name in addition
to the "favourite <whatever>".
From an implementation side, you could also have something like this:
My <label for="country"> favourite country</label> is <input id="country">
and then style the <label> so it's bold. That also gives the mouse user the
benefit of clicking on the bold text and it moves the focus into the field.
- Next message: Birkir R. Gunnarsson: "Re: Form fields in a sentence"
- Previous message: Nick Bromley: "Re: Providing accessible names with
" - Next message in Thread: Birkir R. Gunnarsson: "Re: Form fields in a sentence"
- Previous message in Thread: Patrick H. Lauke: "Re: Form fields in a sentence"
- View all messages in this Thread