<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Marco's accessibility blog &#187; aria-describedby</title>
	<atom:link href="http://www.marcozehe.de/tag/aria-describedby/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.marcozehe.de</link>
	<description>Musings, tips and tricks about the accessible software world</description>
	<lastBuildDate>Tue, 22 Jun 2010 07:26:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Easy ARIA tip #2: aria-labelledby and aria-describedby</title>
		<link>http://www.marcozehe.de/2008/03/23/easy-aria-tip-2-aria-labelledby-and-aria-describedby/</link>
		<comments>http://www.marcozehe.de/2008/03/23/easy-aria-tip-2-aria-labelledby-and-aria-describedby/#comments</comments>
		<pubDate>Sun, 23 Mar 2008 20:29:46 +0000</pubDate>
		<dc:creator>Marco</dc:creator>
				<category><![CDATA[ARIA]]></category>
		<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[aria-describedby]]></category>
		<category><![CDATA[aria-labelledby]]></category>
		<category><![CDATA[attribute]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://www.marcozehe.de/2008/03/23/easy-aria-tip-2-aria-labelledby-and-aria-describedby/</guid>
		<description><![CDATA[Sorry it took me so long to get back to it, but here it is, my second tip on the usage of some easy ARIA markup to make your sites more accessible. Imagine this: You have a form where you ask your user a question, but the answer is actually part of the sentence the [...]]]></description>
			<content:encoded><![CDATA[<p>Sorry it took me so long to get back to it, but here it is, my second tip on the usage of some easy ARIA markup to make your sites more accessible.</p>
<p>Imagine this: You have a form where you ask your user a question, but the answer is actually part of the sentence the question is made of. A classic example we all know from our browser settings is the setting &#8220;Delete history after x days&#8221;. &#8220;Delete history after&#8221; is to the left of the textbox, x is the number, for example 21, and the word &#8220;days&#8221; follows the textbox, actually forming a sentence that is easy to understand.</p>
<p>If you&#8217;re using a screen reader, have you noticed that, when you go to this setting in Firefox, it actually tells you &#8220;Delete history after 21 days&#8221;?, followed by the announcement that you&#8217;re in a textbox, and that it contains the number 21. Isn&#8217;t that cool? You do not need to navigate around to find out the unit. &#8220;Days&#8221; could easily be &#8220;months&#8221; or &#8220;years&#8221;, and in many ordinary dialogs, there is no way to find this out other than navigating around with screen reviewing commands.</p>
<p>Well, we have to thank Aaron and all the other great people who invented ARIA, for this capability! The solution is in an ARIA attribute called <strong>aria-labelledby</strong>. Its parameter is a string that consists of the IDs of the HTML or XUL elements you want to concatenate into a single accessible name. Yes, you read right, this not only works in HTML, but in XUL, too!</p>
<p>A second attribute that works very similarly is called <strong>aria-describedby</strong>. It can also take IDs of one or more elements to make up an additional description. In Microsoft Active Accessibility, this is converted into the AccDescription of the element. Some screen readers like NVDA pick this description up and speak it automatically after the name and type of the control, assuming that this information is giving the visually impaired user additional information that a sighted user also gets.</p>
<p><strong>aria-labelledby</strong> and <strong>aria-describedby</strong> are both specified within the element that is to be labelled, for example an html:input or a xul:textbox. In both cases, the <strong>label for</strong>/<strong>label control</strong> bindings that may also exist, are overridden by <strong>aria-labelledby</strong>. If on an HTML page you provide <strong>aria-labelledby</strong>, you should also provide a <strong>label for</strong> construct to also support older browsers that do not have ARIA support yet. With Firefox 3, your blind users will automatically get the better accessibility of the new attribute, but the users of older browsers are not left in the dark this way.</p>
<p>And here is an example I made up for demonstration purposes:</p>
<p><code></p>
<form method="post.php">
<div>
<span id="labelShutdown"><label for="shutdownTime">Shut down computer after</label></span></p>
<input id="shutdownTime" type="text" value="10" aria-labelledby="labelShutdown shutdownTime shutdownUnit" aria-describedby="shutdownDescriptor"/>
<span id="shutdownUnit"> minutes</span>
</div>
<div id="shutdownDescriptor">Allows you to specify the number of minutes of inactivity after which your computer should shut down.</div>
</form>
<p></code></p>
<h3>A Note for JAWS 8 users</h3>
<p>JAWS 8.0 has its own logic to find labels, causing it to always override the accessibleName the textbox of an HTML document gets. With JAWS 8, I have not found a way to get it to accept the label from the example above. But NVDA and Window-Eyes do it just fine, and Orca on Linux also has no problems.</p>
<h5>Previous Easy ARIA tips</h5>
<ol>
<li><a href="http://www.marcozehe.de/2008/02/29/easy-aria-tip-1-using-aria-required/">aria-required</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.marcozehe.de/2008/03/23/easy-aria-tip-2-aria-labelledby-and-aria-describedby/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
