Input Type Image without label causes validation error

Created on 4 October 2013, about 12 years ago
Updated 9 May 2025, 5 months ago

Using an image (type="image") as the submit button causes the achecker accessibility scanner to throw an error.

3.3 Input Assistance: Help users avoid and correct mistakes.
Success Criteria 3.3.2 Labels or Instructions (A)
Check 188: Label text is empty.
Repair: Add text to the label element.
<input alt="Search" class="custom-search-button form-submit" type="image" id="edit-submit" name="op" ...

Basically, it's looking for a label element beside the input type="image" element. But according to the w3c input elements with the type of image do not require a label element if the input type="image" element has a populated alt text attribute, as that serves as an implicit label.

Frankly, I don't recall ever seeing labels beside inputs of image type, so I find it hard to believe that achecker is not happy with this.

I guess this is not really a bug with custom search, but I am trying to look for reasons as to why the scanner is unsatisfied with the implementation. We are currently adding a label element beside the image input type to satisfy the scanner via a custom module.

Thanks for any help in advance.

πŸ’¬ Support request
Status

Closed: outdated

Version

1.13

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada humanaut

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024