Skip to content

Commit b034ff5

Browse files
scottaoharagiacomo-petrimbgowerpatrickhlauke
authored
Update 3.3.2 understanding doc and g167 technique (#4102)
closes #4088 includes new icon-button example in G167 to showcase how a button represented by an icon alone can be used in certain instances for labeling form fields also updates the understanding doc to provide two new written examples to the examples section list. One to not make someone have to know to look to g167 to understand that "icons" can also serve as labels And the second to provide an example of how two websites could have the same sort of input, but one needs instructions (due to extra requirements) while another doesn't (because they are super chill). --------- Co-authored-by: Giacomo Petri <[email protected]> Co-authored-by: Mike Gower <[email protected]> Co-authored-by: Patrick H. Lauke <[email protected]>
1 parent d3385ba commit b034ff5

File tree

4 files changed

+30
-3
lines changed

4 files changed

+30
-3
lines changed

techniques/general/G167.html

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html><html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"><head><title>Using an adjacent button to label the purpose of a field</title><link rel="stylesheet" type="text/css" href="../../css/editors.css" class="remove"/></head><body><h1>Using an adjacent button to label the purpose of a field</h1><section class="meta"><p class="id">ID: G167</p><p class="technology">Technology: general</p><p class="type">Type: Technique</p></section><section id="applicability"><h2>When to Use</h2>
22
<p>All technologies that support forms</p>
33
</section><section id="description"><h2>Description</h2>
4-
<p>When a button invokes a function on an input field, has a clear text label, and is rendered adjacent to the input field, the button also acts as a label for the input field. This label helps users understand the purpose of the field without introducing repetitive text on the Web page. Buttons that label single text fields typically follow the input field.</p>
4+
<p>When a button invokes a function on an input field, has a clear text label or name, and is rendered adjacent to the input field, the button also acts as a label for the input field. This label helps users understand the purpose of the field without introducing repetitive text on the web page. Buttons that label single text fields typically follow the input field.</p>
55
<div class="note">
66
<p>The field must also have a programmatically determined name, per
77
<a href="../../Understanding/name-role-value">Success Criterion 4.1.2</a>.</p>
@@ -10,16 +10,31 @@
1010
<section class="example">
1111
<h3>A search function</h3>
1212

13-
<p>A Web page contains a text field where the user can enter search terms and a button labeled "Search" for performing the search. The button is positioned right after the text field so that it is clear to the user that the text field is where to enter the search term.</p>
13+
<p>A web page contains a text field where the user can enter search terms and a button labeled "Search" for performing the search. The button is positioned right after the text field so that it is clear to the user that the text field is where to enter the search term.</p>
1414
<div>
1515
<img alt="A text field with a button positioned to the right demonstrating the use of a button to label a field." src="img/button-as-label.jpg"/>
1616
</div>
17+
<p>Alternatively, a button visually labeled with a "loupe" or "magnify glass" icon, with the alternative text of "search", could be used instead of a button with a text label. Variants of this icon are used to identify search inputs across not just websites, but user interfaces of non-web software as well.</p>
18+
19+
<div>
20+
<img alt="A common visual design and labeling pattern for search fields: a text field with a button, visually represented with a common magnify glass icon, positioned at the start (left) of the text field. the icon serves to both label the button and the text field." src="img/search-button-icon-label.png">
21+
</div>
22+
</section>
23+
24+
<section class="example">
25+
<h3>A "reply" or "send message" field</h3>
26+
<p>A chat or email web application will often present users a single or multi-line text field used for composing a message. The field does not have a visible text label, but the purpose of the field - to compose a message to send - is indicated by its pairing with a button represented by a "send message" icon. The icon serving the dual purpose of visually labelling the button, as well as the text field.</p>
27+
28+
<div>
29+
<img src="img/button-send-message.jpg" width="360" alt="text field containing the text 'let's go'. The field has a button visually overlaying the right side of it. The button is circular and contains an arrow icon that also resembles a paper airplane - which has increasingly gained popularity as a 'send message' identifier.">
30+
</div>
1731

1832
</section>
33+
1934
<section class="example">
2035
<h3>Picking a form</h3>
2136

22-
<p>A user in the United States must fill in a form. Since the laws and requirements are different in different states within the United States, the user must select the version of a form for their state of residence. A dropdown list allows the user to pick a state. The adjacent button is labeled "Get Form for State." Pressing the button takes the user to the Web page containing the form for the selected state.</p>
37+
<p>A user in the United States must fill in a form. Since the laws and requirements are different in different states within the United States, the user must select the version of a form for their state of residence. A dropdown list allows the user to pick a state. The adjacent button is labeled "Get Form for State." Pressing the button takes the user to the web page containing the form for the selected state.</p>
2338

2439
</section>
2540
</section><section id="tests"><h2>Tests</h2>
@@ -28,6 +43,7 @@ <h3>Picking a form</h3>
2843
<ol>
2944
<li>Check that the field and button are adjacent to one another in the programmatically determined reading sequence.</li>
3045
<li>Check that the field and button are visually rendered adjacent to one another.</li>
46+
<li>Where the button does not have a visible text label, check that it has an accessible name</li>
3147
</ol>
3248
</section>
3349
<section class="results"><h3>Expected Results</h3>
4.83 KB
Loading
3.51 KB
Loading

understanding/20/labels-or-instructions.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,17 @@ <h2>Examples of Labels or Instructions</h2>
9595
<li>A field for entering a date has text instructions to indicate the correct format
9696
for the date.
9797
</li>
98+
99+
<li>On one website, a field with the text label of "username" is provided for someone to create a username to login to a website.
100+
On another website, there are strict rules about what characters can be used to create a username. On this website additional instructions
101+
would need to accompany the field to prevent users from encountering unnecessary errors.
102+
</li>
103+
104+
<li>A website provides a global search field in the header of the site. Any term can be entered,
105+
so there are no instructions needed, but the field needs a cue to communicate its purpose. Commonly, such search
106+
field will be paired with a "loupe" or "magnify glass" search icon, serving as its visible label, if not also doubling
107+
as the visual identifier for the button that submits the search query.
108+
</li>
98109

99110
<li>To enter their name, users are provided with two separate text fields. Rather than
100111
having a single label "Name" (which would appear to leave the second text field unlabelled),

0 commit comments

Comments
 (0)