inclusive-design / AChecker

Automated interactive Web content accessibility checker.
https://achecker.ca
GNU General Public License v2.0
70 stars 61 forks source link

Input type=image bug #102

Open spektred opened 5 years ago

spektred commented 5 years ago

Achecker is fine with this code. No errors.

<label for="example">Let's submit some text</label> <input type="text" id="example" name="text"> <input type="submit" id="text" value="Send">

But if you replace the <input type="submit" id="text" value="Send"> with <input type="image" id="text" value="Send" src="image.gif" alt="image"> then it returns an error message about needing an additional label for the <input type="image"> tag!

This is wrong. According to W3C, "The element is a button, specifically a Submit Button." https://www.w3.org/TR/html52/sec-forms.html#image-button-state-typeimage

So the image button in itself should not require a label to be added. Please fix this.

spektred commented 5 years ago

Even if you use an implicit label, it still displays an error (about needing a label) for the following code.

<label for="example"> Let's submit some text <input type="text" id="example" name="text"> <input type="image" id="text" value="Send" src="image.gif" alt="image"> </label>

spektred commented 5 years ago

Just a small update. I found out that adding a title="Text Here" attribute on the <input type="image"> element will silence the error. Thank goodness, I thought I was just stuck.

https://stackoverflow.com/a/20528002