Why it matters
- Some older themes and form builders write buttons as
<input type="button">,type="submit"ortype="reset", with the button's text in itsvalue. When thevalueis empty, or missing on a plainbutton, the button shows no text and a screen reader announces only "button". - WCAG 2.2 asks that every control has a name that assistive technology can read (success criterion 4.1.2, level A).
Example
<input id="more" type="button" />
<input id="more" type="button" value="عرض المزيد" />
How to fix
- Write the button's text in its
value, in the page's language:<input type="button" value="عرض المزيد">. - Or use
<button type="button">عرض المزيد</button>, which has room for an icon beside the text.
How we detect
- We render the page and run axe-core 4.13.0's
input-button-namerule in each engine. - It reports each
<input>of typebutton,submitorresetwithout an accessible name: an emptyvalue, or none on abutton, and noaria-label,aria-labelledbyortitle. - A submit or reset button with no
valueat all is not reported, because the browser gives it a word of its own, which may not be in the page's language. Write avaluein Arabic all the same. - It does not apply to pages without buttons of this kind.
<button>elements are checked by another axe rule, which Arablyzer also reads.