Input buttons must have discernible text

Rule ID: input-button-name
Ruleset: axe-core 4.7
User Impact: Critical
Guidelines: WCAG 2.1 (A), WCAG 2.0 (A), Section 508, Trusted Tester

Need accessibility training?

Deque University offers an extensive curriculum of self-guided online courses for every skillset and experience level.

Start learning today

Compliance Data & Impact

User Impact

Critical
Minor
Critical

Disabilities Affected

  • Blind
  • Deafblind

Standard(s)

  • WCAG 2.1 (A)
  • WCAG 2.0 (A)
  • Section 508
  • Trusted Tester

WCAG Success Criteria [WCAG 2.1 (A)]

  • 4.1.2: MUST: Name, Role, Value

WCAG Success Criteria [WCAG 2.0 (A)]

  • 4.1.2: MUST: Name, Role, Value

Section 508 Guidelines

  • 1194.22: MUST: Web based intranet and Internet Information & Applications
  • 1194.22 (a): MUST: A text equivalent for every non-text element shall be provided (e.g., via "alt", "longdesc", or in element content)

Trusted Tester Guidelines

  • 5.C: MUST: The combination of the accessible name, accessible description, and other programmatic associations (e.g., table column and/or row associations) describes each input field and includes all relevant instructions and cues (textual and graphical).

How to Fix the Problem

Correct markup solutions

Eleven markup patterns pass the input-button-name test criteria:

<form action="#">
    <input type="button" id="pass1" value="Button Name" />
    <input type="button" id="pass2" aria-label="Name" />
    <input type="button" id="pass3" aria-labelledby="labeldiv" />
    <input type="button" id="pass4" value="Name" aria-label="Aria Name" />
    <input type="submit" id="pass5" />
    <input type="submit" value="Something" id="pass6" />
    <input type="reset" id="pass7" />
    <input type="reset" value="Something" id="pass8" />
    <input type="button" title="Something" id="pass9" />
    <input type="submit" title="Something" id="pass10" />
    <input type="reset" title="Something" id="pass11" />
</form>

Incorrect markup solutions

Five markup patterns fail the input-button-name test criteria:

<form action="#">
    <input type="button" id="fail1" />
</form>
 
<form action="#">
    <input type="button" id="fail2" aria-label="" />
</form>
 
<form action="#">
    <input type="button" id="fail3" aria-labelledby="nonexistent" />
</form>
 
<form action="#">
    <input type="button" id="fail4" aria-labelledby="emptydiv" />
    <div id="labeldiv">Button label</div>
    <div id="emptydiv"></div>
</form>
 
<form action="#">
    <input type="submit" value="" id="fail5" />
</form>
 
<form action="#">
    <input type="reset" value="" id="fail6" />
</form>

Why it Matters

Screen reader users are not able to discern the purpose of an input type="button" without an accessible name.

Screen reader users cannot understand the purpose of an image without a discernable and accessible textual name. A title for an image may provide only advisory information about the image itself. Unnamed actionable graphic images such as buttons have no clear description of the destination, purpose, function or action for the non-text content when it is intended to be used as a control.

Rule Description

Ensures input buttons have discernible text.

The input-button-name rule separates functionality from the button-name rule to ensure that input buttons have discernible text; advise relevant to input button names was incorrect for button elements.

The Algorithm (in simple terms)

Input buttons must have discernible text.

Resources

Refer to the complete list of axe 4.7 rules.

Was this information helpful?

You have already given your feedback, thank you..

Your response was as follows:

Was this information helpful?
Date/Time feedback was submitted:

'; document.getElementById("form_message").innerHTML = checkMarkAnimation + msg + "
"; if (!!window.MSInputMethodContext && !!document.documentMode ) document.getElementById("form_message").innerHTML = checkMark + msg + "
"; else document.getElementById("form_message").innerHTML = checkMarkAnimation + msg + "
"; } if(type === "warning" ) { document.getElementById("form_message").style.color = "#916216"; document.getElementById("form_message").innerHTML = warningIcon + msg + "
"; } if(type === "error" ) { document.getElementById("form_message").style.color = "#b40909"; document.getElementById("form_message").innerHTML = errorIcon + msg + "
"; } document.getElementById("form_message").tabIndex = -1; document.getElementById("form_message").focus(); } function clearMessage() { document.getElementById("form_message").innerHTML = ""; } function showFeedbackForm() { document.getElementById("feedback-form").className = ""; document.getElementById("feedback-info").className = "deque-hidden"; document.getElementById("yesButton").focus(); setTimeout((function (){ document.getElementById("yesButton").focus(); }), 5000); } function hideFeedbackForm() { if( feedbackData ) { document.getElementById("feedback-info").className = ""; showMessage("You have cancelled editing your earlier feedback.", "warning"); } document.getElementById("feedback-form").className = "deque-hidden"; document.getElementById("yesButton").style.display = ""; document.getElementById("noButton").style.display = ""; document.getElementById("noFeedback").className = "deque-hidden"; setTimeout((function() { clearMessage(); }), 4000); }