HTML_CodeSniffer icon indicating copy to clipboard operation
HTML_CodeSniffer copied to clipboard

question to principle4.guideline4_1.4_1_2.h91.inputtext.name

Open LuciaLux opened this issue 2 years ago • 1 comments

I have this input

<input _ngcontent-c1="" autocomplete="off" id="searchInput" name="query" required="" type="text" placeholder="Cerca" class="ng-untouched ng-pristine ng-invalid">

and the following error is generated:

Principle4.Guideline4_1.4_1_2.h91.InputText.Name 
THIS TEXTINPUT ELEMENT DOES NOT HAVE A NAME AVAILABLE TO AN ACCESSIBILITY API. VALID NAMES ARE: LABEL ELEMENT, TITLE UNDEFINED, ARIA-LABEL UNDEFINED, ARIA-LABELLEDBY UNDEFINED.

my question is: the value given to the title, the ARIA-LABEL and the ARIA-LABELLEDBY, ie undefined, is correct?

LuciaLux avatar Nov 02 '22 12:11 LuciaLux

The error looks correct to me. From the example you posted there is no programatic way to determine what accessible text is available. I'd suggest looking at the WCAG guidelines for possible remediations. The technique might not be exactly what you are after from the error message, but this should help: https://www.w3.org/WAI/WCAG22/Techniques/html/H44

ironikart avatar Nov 03 '22 00:11 ironikart