Skip to content

Commit b283fc2

Browse files
committed
Update G211 prose and wrong working example
* correct the figure numbering * remove the inline working example * reuse the existing (but unlinked) `example3.html` to provide the actual working example for simplified accName Closes #4554
1 parent ca7d938 commit b283fc2

File tree

3 files changed

+12
-33
lines changed

3 files changed

+12
-33
lines changed

techniques/general/G211.html

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ <h3>Range of inputs with few labels</h3>
132132
<p>A less common disparity between labels and inputs can occur when a group of radio buttons is set up to elicit a choice across a range. The labels may only be located at each end of the range or may be interspersed at various points in the range.</p>
133133
<figure id="figure-rate-response">
134134
<img src="img/rate-response.png" alt="Rate your response, Hated it, Loved it">
135-
<figcaption>Figure 6 Line of 5 radio buttons with Hated it and Loved it labels at each end</figcaption>
135+
<figcaption>Figure 5 Line of 5 radio buttons with Hated it and Loved it labels at each end</figcaption>
136136
</figure>
137137

138138
<p>The two labels, "Hated it" and "Loved it", are adjacent to the first and last radio buttons, and should be their accessible names. Speech-input users can speak either of these labels to select a radio button, and then use arrow navigation (e.g., "Press right arrow") to modify the selection. "Rate your response" is the text describing the whole widget and can be associated as the group label (here using <code class="language-html">legend</code>). The three middle radio buttons do not have visible labels. In the code example they are given title attributes of "Disliked", "So-so" and "Liked" in order to meet 3.3.2 Labels or Instructions.</p>
@@ -154,37 +154,17 @@ <h3>Range of inputs with few labels</h3>
154154
<h3>Text in parentheses and punctuation</h3>
155155
<p>Technique G211 is not intended to complicate existing conventions for the construction of accessible form inputs. As described in the <em>Punctuation and capitalization</em> and <em>Text in parentheses</em> subsections of the Understanding document, information does not always need to be included in the accessible name in an attempt to meet the Label in Name requirement, especially where the text would not normally be spoken when using speech recognition to navigate to controls. Where there are established ways of ensuring information and relationships conveyed visually are present programmatically, it is acceptable to leave text in parentheses and punctuation out of the accessible name.</p>
156156
<p>The following snippet demonstrates possible techniques mentioned in the Understanding document. Since the required field is programmatically indicated, and the input restrictions on the date are surfaced through <code class="language-html">aria-describedby</code>, the asterisk and parenthetical information has been left out of the accessible name.</p>
157-
157+
<figure id="figure-rate-response">
158+
<img src="img/inputs-simplified-accname.png" alt="Two text inputs: one with a label of 'Name' with an asterisk, one with a label of 'Birth date' and, in parentheses, YYYY-MM-DD">
159+
<figcaption>Figure 6 The "Name" and "Birth date" labels with additional information (and asterisk and an input formatting instruction, respectively)</figcaption>
160+
</figure>
158161
<pre><code class="language-html">
159162
&lt;label for="name"&gt;Name&lt;/label&gt; *
160163
&lt;input type="text" name="name" id="name" required&gt;
161164
&lt;label for="birth"&gt;Birth date&lt;/label&gt; &lt;span id="mask"&gt;(YYYY-MM-DD)&lt;/span&gt;
162165
&lt;input type="text" name="birth" id="birth" aria-describedby="mask"&gt;</code></pre>
163166

164-
<section>
165-
<h4>Working sample of inputs with simplified accessible names</h4>
166-
167-
168-
<div><label for="name">Name</label> *</div>
169-
<input type="text" name="name" id="name" required="required">
170-
<div><label for="birth">Birthdate</label> <span id="mask">(YYYY-MM-DD)</span></div>
171-
<input type="text" name="birth" id="birth" aria-describedby="mask">
172-
</section>
173-
174-
<p>
175-
<code>
176-
&lt;fieldset&gt;<br>&lt;legend&gt;Rate your response&lt;/legend&gt;<br>
177-
&lt;label for="hated"&gt;Hated it&lt;/label&gt; <br>
178-
&lt;input type="radio" name="meal" id="hated" value="hated"&gt;<br>
179-
&lt;input type="radio" name="meal" id="poor" value="poor" title="Disliked"&gt;<br>
180-
&lt;input type="radio" name="meal" id="neutral" value="neutral" title="So-so"&gt;<br>
181-
&lt;input type="radio" name="meal" id="okay" value="okay" title="Liked"&gt;<br>
182-
&lt;input type="radio" name="meal" id="loved" value="loved"&gt;<br>
183-
&lt;label for="loved"&gt;Loved it&lt;/label&gt;<br>
184-
&lt;/fieldset&gt;<br>
185-
</code>
186-
</p>
187-
<p class="working-example"><a href="../../working-examples/label-in-name-general/example4.html">Working example of range of inputs</a></p>
167+
<p class="working-example"><a href="../../working-examples/label-in-name-general/example3.html">Working example of inputs inputs with simplified accessible names</a></p>
188168

189169
</section>
190170
</section>
1.4 KB
Loading

working-examples/label-in-name-general/example3.html

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
66

7-
<title>Example of Work Phone input set</title>
7+
<title>Example of inputs inputs with simplified accessible names</title>
88
<style>
99
html{
1010
background: white;
@@ -19,14 +19,13 @@
1919
letter-spacing: inherit;
2020
word-spacing: inherit;
2121
}
22+
input { display: block; }
2223
</style>
2324
</head>
2425
<body>
25-
<div role="group" aria-labelledby="groupLabel">
26-
<span id="groupLabel">Work Phone:</span>
27-
<input type="tel" aria-labelledby="groupLabel" title="area code">
28-
<input type="tel" title="prefix">
29-
<input type="tel" title="line number">
30-
</div>
26+
<label for="name">Name</label> *
27+
<input type="text" name="name" id="name" required>
28+
<label for="birth">Birth date</label> <span id="mask">(YYYY-MM-DD)</span>
29+
<input type="text" name="birth" id="birth" aria-describedby="mask">
3130
</body>
3231
</html>

0 commit comments

Comments
 (0)