Validating aria-required

<input type="text" name="author" id="author" value="" size="22" tabindex="1" aria-required='true' />

The above line of code simply will not validate due to the aria-required tag. I am I have read the reasons why, and I have looked for solutions but been unable to find anything I can implement that works.

The tag is called in part by a PHP echo which which controls all the comment form fields and looks like this:

<input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> />

Validate this sample link for example:

http://totalphysiqueonline.com/2009/01/26/ironmaster-im2000-self-spotting-system-review/

Has anyone run into this issue before? Is there a work around? I really want my site to validate.

If you use non-standard attributes, the document won’t be valid. There’s no real workaround, unless you want to set up your own DTD (and that’s pointless, since browsers don’t read DTDs).

Of course you could add the non-standard attribute using JavaScript, which would fool the HTML validator, but the document would still be invalid.

You have two choices: conform to the standards or accept that a non-compliant document won’t validate.

I am all for conforming to the standards. What would happen if I remove that particular code from the input field? Would that break the comment field? Why is it there in the first place? What does it do?

Thanks for such a quick reply!

POSTSCRIPT: From what I have read, aria-required is a handicap-man accessibility feature that allows folks with disabilities to know that certain fields are required by way of a screen readers voice alert saying, “hey moron, this is a required field”. Lots of browsers, well I should say some, do support it and some don’t.

Opera and FF support it. IE doesn’t. Ain’t that just like MS to spoil the fun for everyone. And this from a company whose founder feels like opening a swarm of mosquitos on an unsuspecting audience because he is riddled with guilt over the fact that Americans don’t have to suffer with malaria - in other words MS is run by a bunch of liberals who you would think would be ALL OVER accessibility. But NOOOOOOOOOOOOO not MS.

So, for now the html W3 consortium is not going to accept aria-required until MS decides to play ball.

At least that is my take on the issue.

I will leave the aria-required value IN. Why? Because I care. That’s why. Even if MS doesn’t.

I think Hussein Obama should print up another 700 trillion dollars to generate some meaningful support for the aria-required compliance issue.

This thread is over 1-year old.

Hmm, WAI-ARIA isn’t even a Technical Recommendation yet and not all people with disabilities like myself use Assistive technology you have to remember that.

Furthermore if you should be using: http://www.w3.org/WAI/ARIA/schemata/xhtml-aria-1.dtd on the lines of:

<?xml version="1.0" encoding="UTF-8"?>
       <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+ARIA 1.0//EN"
     "http://www.w3.org/MarkUp/DTD/xhtml-aria-1.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

However, you could validate it against a true Validating XML Parser; anyway instead of the W3C.

This: Indicates that user input is required on the element before a form may be submitted.

Else practically none; it a non-normative Draft document in the first place don’t worry yourself with it but theoretically it could interact with some Assistive technologies.

By theoretically increasing the accessibility of “dynamic content” and user interface components developed with Ajax, HTML, JavaScript and related technologies, etc.

Noooo! Please don’t.

http://lists.w3.org/Archives/Public/wai-xtech/2009Jun/0052.html

http://html5.validator.nu/ and http://validator.w3.org/ with “HTML5” override (or using <!doctype html> as the doctype) will validate ARIA markup. (It’s also more accurate than DTD validation.)