Serhiy
Serhiy

Reputation: 2555

input buttons and 508 compliance: do they really need labels?

Does a button with a value really need a matching label tag in order to be 508 compliant?

Say I have:

<label for="search_box" class="hideme">search query</label>
<input type="text" id="search_box">
<input type="button" id="search" value="Search">

The web accessibility testing software is flagging it since it has an id but no matching label? Is it really necessary?

Upvotes: 1

Views: 3014

Answers (1)

Ryan B
Ryan B

Reputation: 3392

A <label> is not needed for <input type="button">, you need to provide a value attribute. If the button is using an image versus text, you need to provide an alt to be compliant.

<input type="button" src="....jpg" alt="Search" id="...">

Upvotes: 3

Related Questions