| 38 | Name 39 | | 40 |41 | Height 42 | | 43 |44 | Age 45 | | 46 |
|---|---|---|
| 49 | Walter 50 | | 51 |6'4 | 52 |34 | 53 |
| 56 | Steve 57 | | 58 |5'4 | 59 |30 | 60 |
| 68 | Name 69 | | 70 |71 | Height 72 | | 73 |74 | Age 75 | | 76 |
|---|---|---|
| 79 | Walter 80 | | 81 |6'4 | 82 |34 | 83 |
| 86 | Steve 87 | | 88 |5'4 | 89 |30 | 90 |
| 102 | Name 103 | | 104 |105 | Height 106 | | 107 |108 | Age 109 | | 110 ||
|---|---|---|---|
| 113 | Feet 114 | | 115 |116 | Inches 117 | | 118 |||
| 121 | Walter 122 | | 123 |6 | 124 |4 | 125 |34 | 126 |
| 129 | Steve 130 | | 131 |5 | 132 |4 | 133 |30 | 134 |
| 142 | Name 143 | | 144 |145 | Height 146 | | 147 |148 | Age 149 | | 150 ||
|---|---|---|---|
| 153 | Feet 154 | | 155 |156 | Inches 157 | | 158 |||
| 161 | Walter 162 | | 163 |6 | 164 |4 | 165 |34 | 166 |
| 169 | Steve 170 | | 171 |5 | 172 |4 | 173 |30 | 174 |
` element for the page title. On the home page, this is usually the title of the site and on other pages, this may be the page title. Use the `` element once per page—some assistive technology may be unable to read multiple ``s on a single page correctly. Other heading levels may be used more than once following document outline order.
13 |
14 | **Note:** `` and `` elements may allow you to reset the heading order allowing you to "restart" heading levels at `` according to the HTML5 spec. At this point, we are unaware of any browsers that support this feature beyond general HTML5 conformance checkers. For this reason, we recommend developers maintain the document outline with `h1-h6` when using HTML5 outline elements.
15 |
16 | For sub sections, use `` to `` in document outline order. `` is the most important and `` is the least. Avoid skipping headings. Avoid breaking document outline order (you may go from `` to ``, but never `` to ``).
17 |
18 | For logos that are text-based, use `` element.
19 |
20 | If your logo is an image and acting as the main heading of the page, add an `` element for its text and use a `sr-only` rule so it's visibly hidden but accessible to screen reader users.
21 |
22 | The following code snippet shows one example of proper section and subsection heading hierarchy.
23 |
24 | ```html
25 | Section
26 | lorum ipsum
27 | Sub Section
28 | lorum ipsum
29 | ```
30 |
31 | ## Testing
32 |
33 | 1. Identify visual 'heading' elements
34 | 2. Check that all visual 'heading' elements use an `` tag
35 | 3. Verify that all sub heading elements have a higher number
36 |
37 | ## Examples
38 |
39 | ### Passes
40 |
41 |
42 | Category
43 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
44 | Sub Category 1
45 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
46 | Sub Category 2
47 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
48 |
49 |
50 | ```html
51 |
52 | Category
53 |
54 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
55 | Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam.
56 | Donec lobortis diam a ligula faucibus mattis.
57 |
58 | Sub category 1
59 |
60 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
61 | Nam sit amet auctor lectus. Curabitur non est nibh.
62 | Suspendisse vehicula fermentum quam.
63 | Donec lobortis diam a ligula faucibus mattis.
64 |
65 | Sub category 2
66 |
67 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
68 | Nam sit amet auctor lectus. Curabitur non est nibh.
69 | Suspendisse vehicula fermentum quam.
70 | Donec lobortis diam a ligula faucibus mattis.
71 |
72 |
73 | ```
74 |
75 | > This section has a main category and two sub categories. The sub categories are on the same level and as such use the the same heading element.
76 |
77 | ### Fails
78 |
79 |
80 | Category
81 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
82 | Sub Category 1
83 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
84 | Sub Category 2
85 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
86 |
87 |
88 | ```html
89 |
90 | Category
91 |
92 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
93 | Nam sit amet auctor lectus. Curabitur non est nibh.
94 | Suspendisse vehicula fermentum quam.
95 | Donec lobortis diam a ligula faucibus mattis.
96 |
97 | Sub category 1
98 |
99 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
100 | Nam sit amet auctor lectus. Curabitur non est nibh.
101 | Suspendisse vehicula fermentum quam.
102 | Donec lobortis diam a ligula faucibus mattis.
103 |
104 | Sub category 2
105 |
106 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
107 | Nam sit amet auctor lectus. Curabitur non est nibh.
108 | Suspendisse vehicula fermentum quam.
109 | Donec lobortis diam a ligula faucibus mattis.
110 |
111 |
112 | ```
113 |
114 | > This section has several issues. The first sub category has a lower value than the main category. The second sub category has skipped a heading level which while is better, this can cause confusion as it's not clear if this category is the sub category of `Category` or `Sub category 1`
115 |
--------------------------------------------------------------------------------
/_includes/components/header.html:
--------------------------------------------------------------------------------
1 | {% if header %}
2 |
3 | {% if header.type == 'basic' %}
4 |
5 | {% elsif header.type == 'basic-mega' %}
6 |
7 | {% elsif header.type == 'extended' or header.type == 'extended-mega' %}
8 |
9 | {% endif %}
10 |
11 | {% if header.type == 'basic' or header.type == 'basic-mega' %}
12 |
13 | {% endif %}
14 |
32 |
33 |
188 |
189 | {% if header.type == 'basic' or header.type == 'basic-mega' %}
190 |
191 | {% endif %}
192 |
193 | {% endif %}
194 |
--------------------------------------------------------------------------------
/pages/forms.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Forms
3 | description: 'How we work with forms'
4 | permalink: /forms/
5 | page_title: Forms
6 | layout: post
7 | sidenav: docs
8 | ---
9 | Making forms accessible is a simple process. Each form element should be associated with its instructions and errors, and everything should be accessible via the keyboard.
10 |
11 | ## Testing
12 |
13 | 1. Identify each form element.
14 | 2. Find all instructions associated with each element.
15 | * __It is a failure if a form element isn't programmatically associated with _all_ instructions. This includes legends, labels, hint text and tooltips.__
16 | * A common way of achieving this is using `fieldset` and `legend` tags. `Fieldset` is used to group a set of elements. `Legend` is the first child of a `fieldset` tag and provides context for those fields.
17 | 3. Ensure all field elements are accessible via the keyboard.
18 | * __If the form cannot be filled out with just a keyboard, this is a failure.__
19 | 4. Check for title attributes
20 | * Title attributes can be a substitute for labels.
21 | * __If the title attributes provides all the related information it passes, if it provides extra information it fails.__
22 | * Title attributes are not accessible via keyboard.
23 |
24 | ## Examples
25 | ### Passes
26 |
27 |
34 |
35 |
41 |
42 |
43 | ```html
44 |
51 |
52 |
58 | ```
59 | > ___Name:___ Each form element has a ```label```, and it's associated with the ```for``` attribute. The ```for``` attribute refers to the ```id``` of the ```input```. When looking at this form, 'First' and 'Last' wouldn't make sense without 'Name.' This is associated with the ```fieldset``` and ```legend```. All elements are wrapped in a ```fieldset```. There can only be one ```legend``` tag per ```fieldset```. Anything in the ```legend``` tag will be associated.
60 |
61 | > ___Favorite Soup:___ ```Fieldset``` and ```legend``` is often used for radio buttons as its the easiest way to associate the radio buttons with the question. Notice there are no ```label```s for the radio buttons, but each button has a ```title``` attribute for assistive technology to read.
62 |
63 | ### Fails
64 |
65 |
72 |
73 |
80 |
81 |
82 | ```html
83 |
90 |
91 |
98 |
99 | ```
100 |
101 | > ___Failure:___ First name label ```for``` and ```id``` don't match.
102 |
103 | > ___Failure:___ "This Question Is Required" is not associated with the form fields.
104 |
105 | > ___Failure:___ The ```title``` tag for Pea Soup indicates it's 'Chick Pea Soup.' This information is not available to keyboard, sighted users.
106 |
107 |
108 | ### How ARIA affects form inputs
109 |
110 | Screen readers vary on what they read and the additional information they provide by default. This is a broad summary of what is read based on VoiceOver for Mac OSX.
111 |
112 | You can test these with your own screen reader. If you have a OSX you can turn VoiceOver on by hitting command+F5.
113 |
114 | **Further information** Using `aria-label` or `aria-labelledby` will cause a screen reader to only read them and not the default label. If you want an input to read from multiple things like an error message, use `aria-labelledby` and pass it the `for` attribute of the label and any additional `id`s you want read. ex. `aria-labelledby='car1 car_description car-error-message'`
115 |
116 | #### No ARIA
117 |
118 | Reads just the `label` and not the description
119 |
120 |
121 |
122 | Please enter Make and Model
123 |
124 | ```html
125 |
126 |
127 | Please enter Make and Model
128 | ```
129 |
130 | **Screen reader reads input as:** `Car Edit text`
131 |
132 |
133 | #### With aria-label
134 |
135 | Reads the `aria-label` and doesn't read the normal `label`.
136 |
137 |
138 |
139 | Please enter Make and Model
140 |
141 | ```html
142 |
143 |
144 | Please enter Make and Model
145 | ```
146 |
147 | **Screen reader reads input as:** `Car, please enter make and model Edit text`
148 |
149 |
150 | #### With aria-labelledby pointing at `carmakedescription`
151 |
152 | Reads only the `aria-labelledby` attribute and not the default label
153 |
154 |
155 |
156 | Please enter Make and Model
157 |
158 | ```html
159 |
160 |
161 | Please enter Make and Model
162 | ```
163 |
164 | **Screen reader reads input as:** `Please enter Make and Model Edit text`
165 |
166 |
167 | #### With aria-labelledby pointing at `carlabel carmakedescription`
168 |
169 | Reads both labels indicated by the `aria-labelledby` attribute
170 |
171 |
172 |
173 | Please enter Make and Model
174 |
175 | ```html
176 |
177 |
178 | Please enter Make and Model
179 | ```
180 |
181 | **Screen reader reads input as:** `Car Please enter Make and Model Edit text`
182 |
183 |
184 | #### With aria-describedby pointing at `carmakedescription`
185 |
186 | JAWS reads both the label and the description. So does VoiceOver, but there is a slight delay before it reads the description.
187 |
188 |
189 |
190 | Please enter Make and Model
191 |
192 | ```html
193 |
194 |
195 | Please enter Make and Model
196 | ```
197 |
198 | **Screen reader reads input as:** `Car Edit text Please enter Make and Model`
199 |
200 |
--------------------------------------------------------------------------------
`s on a single page correctly. Other heading levels may be used more than once following document outline order.
13 |
14 | **Note:** `` and `` elements may allow you to reset the heading order allowing you to "restart" heading levels at `` according to the HTML5 spec. At this point, we are unaware of any browsers that support this feature beyond general HTML5 conformance checkers. For this reason, we recommend developers maintain the document outline with `h1-h6` when using HTML5 outline elements.
15 |
16 | For sub sections, use `` to `` in document outline order. `` is the most important and `` is the least. Avoid skipping headings. Avoid breaking document outline order (you may go from `` to ``, but never `` to ``).
17 |
18 | For logos that are text-based, use `` element.
19 |
20 | If your logo is an image and acting as the main heading of the page, add an `` element for its text and use a `sr-only` rule so it's visibly hidden but accessible to screen reader users.
21 |
22 | The following code snippet shows one example of proper section and subsection heading hierarchy.
23 |
24 | ```html
25 | Section
26 | lorum ipsum
27 | Sub Section
28 | lorum ipsum
29 | ```
30 |
31 | ## Testing
32 |
33 | 1. Identify visual 'heading' elements
34 | 2. Check that all visual 'heading' elements use an `` tag
35 | 3. Verify that all sub heading elements have a higher number
36 |
37 | ## Examples
38 |
39 | ### Passes
40 |
41 |
42 | Category
43 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
44 | Sub Category 1
45 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
46 | Sub Category 2
47 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
48 |
49 |
50 | ```html
51 |
52 | Category
53 |
54 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
55 | Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam.
56 | Donec lobortis diam a ligula faucibus mattis.
57 |
58 | Sub category 1
59 |
60 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
61 | Nam sit amet auctor lectus. Curabitur non est nibh.
62 | Suspendisse vehicula fermentum quam.
63 | Donec lobortis diam a ligula faucibus mattis.
64 |
65 | Sub category 2
66 |
67 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
68 | Nam sit amet auctor lectus. Curabitur non est nibh.
69 | Suspendisse vehicula fermentum quam.
70 | Donec lobortis diam a ligula faucibus mattis.
71 |
72 |
73 | ```
74 |
75 | > This section has a main category and two sub categories. The sub categories are on the same level and as such use the the same heading element.
76 |
77 | ### Fails
78 |
79 |
80 | Category
81 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
82 | Sub Category 1
83 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
84 | Sub Category 2
85 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
86 |
87 |
88 | ```html
89 |
90 | Category
91 |
92 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
93 | Nam sit amet auctor lectus. Curabitur non est nibh.
94 | Suspendisse vehicula fermentum quam.
95 | Donec lobortis diam a ligula faucibus mattis.
96 |
97 | Sub category 1
98 |
99 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
100 | Nam sit amet auctor lectus. Curabitur non est nibh.
101 | Suspendisse vehicula fermentum quam.
102 | Donec lobortis diam a ligula faucibus mattis.
103 |
104 | Sub category 2
105 |
106 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
107 | Nam sit amet auctor lectus. Curabitur non est nibh.
108 | Suspendisse vehicula fermentum quam.
109 | Donec lobortis diam a ligula faucibus mattis.
110 |
111 |
112 | ```
113 |
114 | > This section has several issues. The first sub category has a lower value than the main category. The second sub category has skipped a heading level which while is better, this can cause confusion as it's not clear if this category is the sub category of `Category` or `Sub category 1`
115 |
--------------------------------------------------------------------------------
/_includes/components/header.html:
--------------------------------------------------------------------------------
1 | {% if header %}
2 |
3 | {% if header.type == 'basic' %}
4 |
5 | {% elsif header.type == 'basic-mega' %}
6 |
7 | {% elsif header.type == 'extended' or header.type == 'extended-mega' %}
8 |
9 | {% endif %}
10 |
11 | {% if header.type == 'basic' or header.type == 'basic-mega' %}
12 |
13 | {% endif %}
14 |
32 |
33 |
188 |
189 | {% if header.type == 'basic' or header.type == 'basic-mega' %}
190 |
191 | {% endif %}
192 |
193 | {% endif %}
194 |
--------------------------------------------------------------------------------
/pages/forms.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Forms
3 | description: 'How we work with forms'
4 | permalink: /forms/
5 | page_title: Forms
6 | layout: post
7 | sidenav: docs
8 | ---
9 | Making forms accessible is a simple process. Each form element should be associated with its instructions and errors, and everything should be accessible via the keyboard.
10 |
11 | ## Testing
12 |
13 | 1. Identify each form element.
14 | 2. Find all instructions associated with each element.
15 | * __It is a failure if a form element isn't programmatically associated with _all_ instructions. This includes legends, labels, hint text and tooltips.__
16 | * A common way of achieving this is using `fieldset` and `legend` tags. `Fieldset` is used to group a set of elements. `Legend` is the first child of a `fieldset` tag and provides context for those fields.
17 | 3. Ensure all field elements are accessible via the keyboard.
18 | * __If the form cannot be filled out with just a keyboard, this is a failure.__
19 | 4. Check for title attributes
20 | * Title attributes can be a substitute for labels.
21 | * __If the title attributes provides all the related information it passes, if it provides extra information it fails.__
22 | * Title attributes are not accessible via keyboard.
23 |
24 | ## Examples
25 | ### Passes
26 |
27 |
34 |
35 |
41 |
42 |
43 | ```html
44 |
51 |
52 |
58 | ```
59 | > ___Name:___ Each form element has a ```label```, and it's associated with the ```for``` attribute. The ```for``` attribute refers to the ```id``` of the ```input```. When looking at this form, 'First' and 'Last' wouldn't make sense without 'Name.' This is associated with the ```fieldset``` and ```legend```. All elements are wrapped in a ```fieldset```. There can only be one ```legend``` tag per ```fieldset```. Anything in the ```legend``` tag will be associated.
60 |
61 | > ___Favorite Soup:___ ```Fieldset``` and ```legend``` is often used for radio buttons as its the easiest way to associate the radio buttons with the question. Notice there are no ```label```s for the radio buttons, but each button has a ```title``` attribute for assistive technology to read.
62 |
63 | ### Fails
64 |
65 |
72 |
73 |
80 |
81 |
82 | ```html
83 |
90 |
91 |
98 |
99 | ```
100 |
101 | > ___Failure:___ First name label ```for``` and ```id``` don't match.
102 |
103 | > ___Failure:___ "This Question Is Required" is not associated with the form fields.
104 |
105 | > ___Failure:___ The ```title``` tag for Pea Soup indicates it's 'Chick Pea Soup.' This information is not available to keyboard, sighted users.
106 |
107 |
108 | ### How ARIA affects form inputs
109 |
110 | Screen readers vary on what they read and the additional information they provide by default. This is a broad summary of what is read based on VoiceOver for Mac OSX.
111 |
112 | You can test these with your own screen reader. If you have a OSX you can turn VoiceOver on by hitting command+F5.
113 |
114 | **Further information** Using `aria-label` or `aria-labelledby` will cause a screen reader to only read them and not the default label. If you want an input to read from multiple things like an error message, use `aria-labelledby` and pass it the `for` attribute of the label and any additional `id`s you want read. ex. `aria-labelledby='car1 car_description car-error-message'`
115 |
116 | #### No ARIA
117 |
118 | Reads just the `label` and not the description
119 |
120 |
121 |
122 | Please enter Make and Model
123 |
124 | ```html
125 |
126 |
127 | Please enter Make and Model
128 | ```
129 |
130 | **Screen reader reads input as:** `Car Edit text`
131 |
132 |
133 | #### With aria-label
134 |
135 | Reads the `aria-label` and doesn't read the normal `label`.
136 |
137 |
138 |
139 | Please enter Make and Model
140 |
141 | ```html
142 |
143 |
144 | Please enter Make and Model
145 | ```
146 |
147 | **Screen reader reads input as:** `Car, please enter make and model Edit text`
148 |
149 |
150 | #### With aria-labelledby pointing at `carmakedescription`
151 |
152 | Reads only the `aria-labelledby` attribute and not the default label
153 |
154 |
155 |
156 | Please enter Make and Model
157 |
158 | ```html
159 |
160 |
161 | Please enter Make and Model
162 | ```
163 |
164 | **Screen reader reads input as:** `Please enter Make and Model Edit text`
165 |
166 |
167 | #### With aria-labelledby pointing at `carlabel carmakedescription`
168 |
169 | Reads both labels indicated by the `aria-labelledby` attribute
170 |
171 |
172 |
173 | Please enter Make and Model
174 |
175 | ```html
176 |
177 |
178 | Please enter Make and Model
179 | ```
180 |
181 | **Screen reader reads input as:** `Car Please enter Make and Model Edit text`
182 |
183 |
184 | #### With aria-describedby pointing at `carmakedescription`
185 |
186 | JAWS reads both the label and the description. So does VoiceOver, but there is a slight delay before it reads the description.
187 |
188 |
189 |
190 | Please enter Make and Model
191 |
192 | ```html
193 |
194 |
195 | Please enter Make and Model
196 | ```
197 |
198 | **Screen reader reads input as:** `Car Edit text Please enter Make and Model`
199 |
200 |
--------------------------------------------------------------------------------
` according to the HTML5 spec. At this point, we are unaware of any browsers that support this feature beyond general HTML5 conformance checkers. For this reason, we recommend developers maintain the document outline with `h1-h6` when using HTML5 outline elements.
15 |
16 | For sub sections, use `` to `` in document outline order. `` is the most important and `` is the least. Avoid skipping headings. Avoid breaking document outline order (you may go from `` to ``, but never `` to ``).
17 |
18 | For logos that are text-based, use `` element.
19 |
20 | If your logo is an image and acting as the main heading of the page, add an `` element for its text and use a `sr-only` rule so it's visibly hidden but accessible to screen reader users.
21 |
22 | The following code snippet shows one example of proper section and subsection heading hierarchy.
23 |
24 | ```html
25 | Section
26 | lorum ipsum
27 | Sub Section
28 | lorum ipsum
29 | ```
30 |
31 | ## Testing
32 |
33 | 1. Identify visual 'heading' elements
34 | 2. Check that all visual 'heading' elements use an `` tag
35 | 3. Verify that all sub heading elements have a higher number
36 |
37 | ## Examples
38 |
39 | ### Passes
40 |
41 |
42 | Category
43 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
44 | Sub Category 1
45 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
46 | Sub Category 2
47 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
48 |
49 |
50 | ```html
51 |
52 | Category
53 |
54 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
55 | Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam.
56 | Donec lobortis diam a ligula faucibus mattis.
57 |
58 | Sub category 1
59 |
60 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
61 | Nam sit amet auctor lectus. Curabitur non est nibh.
62 | Suspendisse vehicula fermentum quam.
63 | Donec lobortis diam a ligula faucibus mattis.
64 |
65 | Sub category 2
66 |
67 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
68 | Nam sit amet auctor lectus. Curabitur non est nibh.
69 | Suspendisse vehicula fermentum quam.
70 | Donec lobortis diam a ligula faucibus mattis.
71 |
72 |
73 | ```
74 |
75 | > This section has a main category and two sub categories. The sub categories are on the same level and as such use the the same heading element.
76 |
77 | ### Fails
78 |
79 |
80 | Category
81 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
82 | Sub Category 1
83 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
84 | Sub Category 2
85 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
86 |
87 |
88 | ```html
89 |
90 | Category
91 |
92 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
93 | Nam sit amet auctor lectus. Curabitur non est nibh.
94 | Suspendisse vehicula fermentum quam.
95 | Donec lobortis diam a ligula faucibus mattis.
96 |
97 | Sub category 1
98 |
99 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
100 | Nam sit amet auctor lectus. Curabitur non est nibh.
101 | Suspendisse vehicula fermentum quam.
102 | Donec lobortis diam a ligula faucibus mattis.
103 |
104 | Sub category 2
105 |
106 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
107 | Nam sit amet auctor lectus. Curabitur non est nibh.
108 | Suspendisse vehicula fermentum quam.
109 | Donec lobortis diam a ligula faucibus mattis.
110 |
111 |
112 | ```
113 |
114 | > This section has several issues. The first sub category has a lower value than the main category. The second sub category has skipped a heading level which while is better, this can cause confusion as it's not clear if this category is the sub category of `Category` or `Sub category 1`
115 |
--------------------------------------------------------------------------------
/_includes/components/header.html:
--------------------------------------------------------------------------------
1 | {% if header %}
2 |
3 | {% if header.type == 'basic' %}
4 |
5 | {% elsif header.type == 'basic-mega' %}
6 |
7 | {% elsif header.type == 'extended' or header.type == 'extended-mega' %}
8 |
9 | {% endif %}
10 |
11 | {% if header.type == 'basic' or header.type == 'basic-mega' %}
12 |
13 | {% endif %}
14 |
32 |
33 |
188 |
189 | {% if header.type == 'basic' or header.type == 'basic-mega' %}
190 |
191 | {% endif %}
192 |
193 | {% endif %}
194 |
--------------------------------------------------------------------------------
/pages/forms.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Forms
3 | description: 'How we work with forms'
4 | permalink: /forms/
5 | page_title: Forms
6 | layout: post
7 | sidenav: docs
8 | ---
9 | Making forms accessible is a simple process. Each form element should be associated with its instructions and errors, and everything should be accessible via the keyboard.
10 |
11 | ## Testing
12 |
13 | 1. Identify each form element.
14 | 2. Find all instructions associated with each element.
15 | * __It is a failure if a form element isn't programmatically associated with _all_ instructions. This includes legends, labels, hint text and tooltips.__
16 | * A common way of achieving this is using `fieldset` and `legend` tags. `Fieldset` is used to group a set of elements. `Legend` is the first child of a `fieldset` tag and provides context for those fields.
17 | 3. Ensure all field elements are accessible via the keyboard.
18 | * __If the form cannot be filled out with just a keyboard, this is a failure.__
19 | 4. Check for title attributes
20 | * Title attributes can be a substitute for labels.
21 | * __If the title attributes provides all the related information it passes, if it provides extra information it fails.__
22 | * Title attributes are not accessible via keyboard.
23 |
24 | ## Examples
25 | ### Passes
26 |
27 |
34 |
35 |
41 |
42 |
43 | ```html
44 |
51 |
52 |
58 | ```
59 | > ___Name:___ Each form element has a ```label```, and it's associated with the ```for``` attribute. The ```for``` attribute refers to the ```id``` of the ```input```. When looking at this form, 'First' and 'Last' wouldn't make sense without 'Name.' This is associated with the ```fieldset``` and ```legend```. All elements are wrapped in a ```fieldset```. There can only be one ```legend``` tag per ```fieldset```. Anything in the ```legend``` tag will be associated.
60 |
61 | > ___Favorite Soup:___ ```Fieldset``` and ```legend``` is often used for radio buttons as its the easiest way to associate the radio buttons with the question. Notice there are no ```label```s for the radio buttons, but each button has a ```title``` attribute for assistive technology to read.
62 |
63 | ### Fails
64 |
65 |
72 |
73 |
80 |
81 |
82 | ```html
83 |
90 |
91 |
98 |
99 | ```
100 |
101 | > ___Failure:___ First name label ```for``` and ```id``` don't match.
102 |
103 | > ___Failure:___ "This Question Is Required" is not associated with the form fields.
104 |
105 | > ___Failure:___ The ```title``` tag for Pea Soup indicates it's 'Chick Pea Soup.' This information is not available to keyboard, sighted users.
106 |
107 |
108 | ### How ARIA affects form inputs
109 |
110 | Screen readers vary on what they read and the additional information they provide by default. This is a broad summary of what is read based on VoiceOver for Mac OSX.
111 |
112 | You can test these with your own screen reader. If you have a OSX you can turn VoiceOver on by hitting command+F5.
113 |
114 | **Further information** Using `aria-label` or `aria-labelledby` will cause a screen reader to only read them and not the default label. If you want an input to read from multiple things like an error message, use `aria-labelledby` and pass it the `for` attribute of the label and any additional `id`s you want read. ex. `aria-labelledby='car1 car_description car-error-message'`
115 |
116 | #### No ARIA
117 |
118 | Reads just the `label` and not the description
119 |
120 |
121 |
122 | Please enter Make and Model
123 |
124 | ```html
125 |
126 |
127 | Please enter Make and Model
128 | ```
129 |
130 | **Screen reader reads input as:** `Car Edit text`
131 |
132 |
133 | #### With aria-label
134 |
135 | Reads the `aria-label` and doesn't read the normal `label`.
136 |
137 |
138 |
139 | Please enter Make and Model
140 |
141 | ```html
142 |
143 |
144 | Please enter Make and Model
145 | ```
146 |
147 | **Screen reader reads input as:** `Car, please enter make and model Edit text`
148 |
149 |
150 | #### With aria-labelledby pointing at `carmakedescription`
151 |
152 | Reads only the `aria-labelledby` attribute and not the default label
153 |
154 |
155 |
156 | Please enter Make and Model
157 |
158 | ```html
159 |
160 |
161 | Please enter Make and Model
162 | ```
163 |
164 | **Screen reader reads input as:** `Please enter Make and Model Edit text`
165 |
166 |
167 | #### With aria-labelledby pointing at `carlabel carmakedescription`
168 |
169 | Reads both labels indicated by the `aria-labelledby` attribute
170 |
171 |
172 |
173 | Please enter Make and Model
174 |
175 | ```html
176 |
177 |
178 | Please enter Make and Model
179 | ```
180 |
181 | **Screen reader reads input as:** `Car Please enter Make and Model Edit text`
182 |
183 |
184 | #### With aria-describedby pointing at `carmakedescription`
185 |
186 | JAWS reads both the label and the description. So does VoiceOver, but there is a slight delay before it reads the description.
187 |
188 |
189 |
190 | Please enter Make and Model
191 |
192 | ```html
193 |
194 |
195 | Please enter Make and Model
196 | ```
197 |
198 | **Screen reader reads input as:** `Car Edit text Please enter Make and Model`
199 |
200 |
--------------------------------------------------------------------------------
` in document outline order. `` is the most important and `` is the least. Avoid skipping headings. Avoid breaking document outline order (you may go from `` to ``, but never `` to ``).
17 |
18 | For logos that are text-based, use `` element.
19 |
20 | If your logo is an image and acting as the main heading of the page, add an `` element for its text and use a `sr-only` rule so it's visibly hidden but accessible to screen reader users.
21 |
22 | The following code snippet shows one example of proper section and subsection heading hierarchy.
23 |
24 | ```html
25 | Section
26 | lorum ipsum
27 | Sub Section
28 | lorum ipsum
29 | ```
30 |
31 | ## Testing
32 |
33 | 1. Identify visual 'heading' elements
34 | 2. Check that all visual 'heading' elements use an `` tag
35 | 3. Verify that all sub heading elements have a higher number
36 |
37 | ## Examples
38 |
39 | ### Passes
40 |
41 |
42 | Category
43 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
44 | Sub Category 1
45 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
46 | Sub Category 2
47 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
48 |
49 |
50 | ```html
51 |
52 | Category
53 |
54 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
55 | Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam.
56 | Donec lobortis diam a ligula faucibus mattis.
57 |
58 | Sub category 1
59 |
60 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
61 | Nam sit amet auctor lectus. Curabitur non est nibh.
62 | Suspendisse vehicula fermentum quam.
63 | Donec lobortis diam a ligula faucibus mattis.
64 |
65 | Sub category 2
66 |
67 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
68 | Nam sit amet auctor lectus. Curabitur non est nibh.
69 | Suspendisse vehicula fermentum quam.
70 | Donec lobortis diam a ligula faucibus mattis.
71 |
72 |
73 | ```
74 |
75 | > This section has a main category and two sub categories. The sub categories are on the same level and as such use the the same heading element.
76 |
77 | ### Fails
78 |
79 |
80 | Category
81 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
82 | Sub Category 1
83 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
84 | Sub Category 2
85 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
86 |
87 |
88 | ```html
89 |
90 | Category
91 |
92 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
93 | Nam sit amet auctor lectus. Curabitur non est nibh.
94 | Suspendisse vehicula fermentum quam.
95 | Donec lobortis diam a ligula faucibus mattis.
96 |
97 | Sub category 1
98 |
99 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
100 | Nam sit amet auctor lectus. Curabitur non est nibh.
101 | Suspendisse vehicula fermentum quam.
102 | Donec lobortis diam a ligula faucibus mattis.
103 |
104 | Sub category 2
105 |
106 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
107 | Nam sit amet auctor lectus. Curabitur non est nibh.
108 | Suspendisse vehicula fermentum quam.
109 | Donec lobortis diam a ligula faucibus mattis.
110 |
111 |
112 | ```
113 |
114 | > This section has several issues. The first sub category has a lower value than the main category. The second sub category has skipped a heading level which while is better, this can cause confusion as it's not clear if this category is the sub category of `Category` or `Sub category 1`
115 |
--------------------------------------------------------------------------------
/_includes/components/header.html:
--------------------------------------------------------------------------------
1 | {% if header %}
2 |
3 | {% if header.type == 'basic' %}
4 |
5 | {% elsif header.type == 'basic-mega' %}
6 |
7 | {% elsif header.type == 'extended' or header.type == 'extended-mega' %}
8 |
9 | {% endif %}
10 |
11 | {% if header.type == 'basic' or header.type == 'basic-mega' %}
12 |
13 | {% endif %}
14 |
32 |
33 |
188 |
189 | {% if header.type == 'basic' or header.type == 'basic-mega' %}
190 |
191 | {% endif %}
192 |
193 | {% endif %}
194 |
--------------------------------------------------------------------------------
/pages/forms.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Forms
3 | description: 'How we work with forms'
4 | permalink: /forms/
5 | page_title: Forms
6 | layout: post
7 | sidenav: docs
8 | ---
9 | Making forms accessible is a simple process. Each form element should be associated with its instructions and errors, and everything should be accessible via the keyboard.
10 |
11 | ## Testing
12 |
13 | 1. Identify each form element.
14 | 2. Find all instructions associated with each element.
15 | * __It is a failure if a form element isn't programmatically associated with _all_ instructions. This includes legends, labels, hint text and tooltips.__
16 | * A common way of achieving this is using `fieldset` and `legend` tags. `Fieldset` is used to group a set of elements. `Legend` is the first child of a `fieldset` tag and provides context for those fields.
17 | 3. Ensure all field elements are accessible via the keyboard.
18 | * __If the form cannot be filled out with just a keyboard, this is a failure.__
19 | 4. Check for title attributes
20 | * Title attributes can be a substitute for labels.
21 | * __If the title attributes provides all the related information it passes, if it provides extra information it fails.__
22 | * Title attributes are not accessible via keyboard.
23 |
24 | ## Examples
25 | ### Passes
26 |
27 |
34 |
35 |
41 |
42 |
43 | ```html
44 |
51 |
52 |
58 | ```
59 | > ___Name:___ Each form element has a ```label```, and it's associated with the ```for``` attribute. The ```for``` attribute refers to the ```id``` of the ```input```. When looking at this form, 'First' and 'Last' wouldn't make sense without 'Name.' This is associated with the ```fieldset``` and ```legend```. All elements are wrapped in a ```fieldset```. There can only be one ```legend``` tag per ```fieldset```. Anything in the ```legend``` tag will be associated.
60 |
61 | > ___Favorite Soup:___ ```Fieldset``` and ```legend``` is often used for radio buttons as its the easiest way to associate the radio buttons with the question. Notice there are no ```label```s for the radio buttons, but each button has a ```title``` attribute for assistive technology to read.
62 |
63 | ### Fails
64 |
65 |
72 |
73 |
80 |
81 |
82 | ```html
83 |
90 |
91 |
98 |
99 | ```
100 |
101 | > ___Failure:___ First name label ```for``` and ```id``` don't match.
102 |
103 | > ___Failure:___ "This Question Is Required" is not associated with the form fields.
104 |
105 | > ___Failure:___ The ```title``` tag for Pea Soup indicates it's 'Chick Pea Soup.' This information is not available to keyboard, sighted users.
106 |
107 |
108 | ### How ARIA affects form inputs
109 |
110 | Screen readers vary on what they read and the additional information they provide by default. This is a broad summary of what is read based on VoiceOver for Mac OSX.
111 |
112 | You can test these with your own screen reader. If you have a OSX you can turn VoiceOver on by hitting command+F5.
113 |
114 | **Further information** Using `aria-label` or `aria-labelledby` will cause a screen reader to only read them and not the default label. If you want an input to read from multiple things like an error message, use `aria-labelledby` and pass it the `for` attribute of the label and any additional `id`s you want read. ex. `aria-labelledby='car1 car_description car-error-message'`
115 |
116 | #### No ARIA
117 |
118 | Reads just the `label` and not the description
119 |
120 |
121 |
122 | Please enter Make and Model
123 |
124 | ```html
125 |
126 |
127 | Please enter Make and Model
128 | ```
129 |
130 | **Screen reader reads input as:** `Car Edit text`
131 |
132 |
133 | #### With aria-label
134 |
135 | Reads the `aria-label` and doesn't read the normal `label`.
136 |
137 |
138 |
139 | Please enter Make and Model
140 |
141 | ```html
142 |
143 |
144 | Please enter Make and Model
145 | ```
146 |
147 | **Screen reader reads input as:** `Car, please enter make and model Edit text`
148 |
149 |
150 | #### With aria-labelledby pointing at `carmakedescription`
151 |
152 | Reads only the `aria-labelledby` attribute and not the default label
153 |
154 |
155 |
156 | Please enter Make and Model
157 |
158 | ```html
159 |
160 |
161 | Please enter Make and Model
162 | ```
163 |
164 | **Screen reader reads input as:** `Please enter Make and Model Edit text`
165 |
166 |
167 | #### With aria-labelledby pointing at `carlabel carmakedescription`
168 |
169 | Reads both labels indicated by the `aria-labelledby` attribute
170 |
171 |
172 |
173 | Please enter Make and Model
174 |
175 | ```html
176 |
177 |
178 | Please enter Make and Model
179 | ```
180 |
181 | **Screen reader reads input as:** `Car Please enter Make and Model Edit text`
182 |
183 |
184 | #### With aria-describedby pointing at `carmakedescription`
185 |
186 | JAWS reads both the label and the description. So does VoiceOver, but there is a slight delay before it reads the description.
187 |
188 |
189 |
190 | Please enter Make and Model
191 |
192 | ```html
193 |
194 |
195 | Please enter Make and Model
196 | ```
197 |
198 | **Screen reader reads input as:** `Car Edit text Please enter Make and Model`
199 |
200 |
--------------------------------------------------------------------------------
` is the least. Avoid skipping headings. Avoid breaking document outline order (you may go from `` to ``, but never `` to ``).
17 |
18 | For logos that are text-based, use `` element.
19 |
20 | If your logo is an image and acting as the main heading of the page, add an `` element for its text and use a `sr-only` rule so it's visibly hidden but accessible to screen reader users.
21 |
22 | The following code snippet shows one example of proper section and subsection heading hierarchy.
23 |
24 | ```html
25 | Section
26 | lorum ipsum
27 | Sub Section
28 | lorum ipsum
29 | ```
30 |
31 | ## Testing
32 |
33 | 1. Identify visual 'heading' elements
34 | 2. Check that all visual 'heading' elements use an `` tag
35 | 3. Verify that all sub heading elements have a higher number
36 |
37 | ## Examples
38 |
39 | ### Passes
40 |
41 |
42 | Category
43 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
44 | Sub Category 1
45 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
46 | Sub Category 2
47 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
48 |
49 |
50 | ```html
51 |
52 | Category
53 |
54 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
55 | Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam.
56 | Donec lobortis diam a ligula faucibus mattis.
57 |
58 | Sub category 1
59 |
60 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
61 | Nam sit amet auctor lectus. Curabitur non est nibh.
62 | Suspendisse vehicula fermentum quam.
63 | Donec lobortis diam a ligula faucibus mattis.
64 |
65 | Sub category 2
66 |
67 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
68 | Nam sit amet auctor lectus. Curabitur non est nibh.
69 | Suspendisse vehicula fermentum quam.
70 | Donec lobortis diam a ligula faucibus mattis.
71 |
72 |
73 | ```
74 |
75 | > This section has a main category and two sub categories. The sub categories are on the same level and as such use the the same heading element.
76 |
77 | ### Fails
78 |
79 |
80 | Category
81 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
82 | Sub Category 1
83 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
84 | Sub Category 2
85 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
86 |
87 |
88 | ```html
89 |
90 | Category
91 |
92 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
93 | Nam sit amet auctor lectus. Curabitur non est nibh.
94 | Suspendisse vehicula fermentum quam.
95 | Donec lobortis diam a ligula faucibus mattis.
96 |
97 | Sub category 1
98 |
99 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
100 | Nam sit amet auctor lectus. Curabitur non est nibh.
101 | Suspendisse vehicula fermentum quam.
102 | Donec lobortis diam a ligula faucibus mattis.
103 |
104 | Sub category 2
105 |
106 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
107 | Nam sit amet auctor lectus. Curabitur non est nibh.
108 | Suspendisse vehicula fermentum quam.
109 | Donec lobortis diam a ligula faucibus mattis.
110 |
111 |
112 | ```
113 |
114 | > This section has several issues. The first sub category has a lower value than the main category. The second sub category has skipped a heading level which while is better, this can cause confusion as it's not clear if this category is the sub category of `Category` or `Sub category 1`
115 |
--------------------------------------------------------------------------------
/_includes/components/header.html:
--------------------------------------------------------------------------------
1 | {% if header %}
2 |
3 | {% if header.type == 'basic' %}
4 |
5 | {% elsif header.type == 'basic-mega' %}
6 |
7 | {% elsif header.type == 'extended' or header.type == 'extended-mega' %}
8 |
9 | {% endif %}
10 |
11 | {% if header.type == 'basic' or header.type == 'basic-mega' %}
12 |
13 | {% endif %}
14 |
32 |
33 |
188 |
189 | {% if header.type == 'basic' or header.type == 'basic-mega' %}
190 |
191 | {% endif %}
192 |
193 | {% endif %}
194 |
--------------------------------------------------------------------------------
/pages/forms.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Forms
3 | description: 'How we work with forms'
4 | permalink: /forms/
5 | page_title: Forms
6 | layout: post
7 | sidenav: docs
8 | ---
9 | Making forms accessible is a simple process. Each form element should be associated with its instructions and errors, and everything should be accessible via the keyboard.
10 |
11 | ## Testing
12 |
13 | 1. Identify each form element.
14 | 2. Find all instructions associated with each element.
15 | * __It is a failure if a form element isn't programmatically associated with _all_ instructions. This includes legends, labels, hint text and tooltips.__
16 | * A common way of achieving this is using `fieldset` and `legend` tags. `Fieldset` is used to group a set of elements. `Legend` is the first child of a `fieldset` tag and provides context for those fields.
17 | 3. Ensure all field elements are accessible via the keyboard.
18 | * __If the form cannot be filled out with just a keyboard, this is a failure.__
19 | 4. Check for title attributes
20 | * Title attributes can be a substitute for labels.
21 | * __If the title attributes provides all the related information it passes, if it provides extra information it fails.__
22 | * Title attributes are not accessible via keyboard.
23 |
24 | ## Examples
25 | ### Passes
26 |
27 |
34 |
35 |
41 |
42 |
43 | ```html
44 |
51 |
52 |
58 | ```
59 | > ___Name:___ Each form element has a ```label```, and it's associated with the ```for``` attribute. The ```for``` attribute refers to the ```id``` of the ```input```. When looking at this form, 'First' and 'Last' wouldn't make sense without 'Name.' This is associated with the ```fieldset``` and ```legend```. All elements are wrapped in a ```fieldset```. There can only be one ```legend``` tag per ```fieldset```. Anything in the ```legend``` tag will be associated.
60 |
61 | > ___Favorite Soup:___ ```Fieldset``` and ```legend``` is often used for radio buttons as its the easiest way to associate the radio buttons with the question. Notice there are no ```label```s for the radio buttons, but each button has a ```title``` attribute for assistive technology to read.
62 |
63 | ### Fails
64 |
65 |
72 |
73 |
80 |
81 |
82 | ```html
83 |
90 |
91 |
98 |
99 | ```
100 |
101 | > ___Failure:___ First name label ```for``` and ```id``` don't match.
102 |
103 | > ___Failure:___ "This Question Is Required" is not associated with the form fields.
104 |
105 | > ___Failure:___ The ```title``` tag for Pea Soup indicates it's 'Chick Pea Soup.' This information is not available to keyboard, sighted users.
106 |
107 |
108 | ### How ARIA affects form inputs
109 |
110 | Screen readers vary on what they read and the additional information they provide by default. This is a broad summary of what is read based on VoiceOver for Mac OSX.
111 |
112 | You can test these with your own screen reader. If you have a OSX you can turn VoiceOver on by hitting command+F5.
113 |
114 | **Further information** Using `aria-label` or `aria-labelledby` will cause a screen reader to only read them and not the default label. If you want an input to read from multiple things like an error message, use `aria-labelledby` and pass it the `for` attribute of the label and any additional `id`s you want read. ex. `aria-labelledby='car1 car_description car-error-message'`
115 |
116 | #### No ARIA
117 |
118 | Reads just the `label` and not the description
119 |
120 |
121 |
122 | Please enter Make and Model
123 |
124 | ```html
125 |
126 |
127 | Please enter Make and Model
128 | ```
129 |
130 | **Screen reader reads input as:** `Car Edit text`
131 |
132 |
133 | #### With aria-label
134 |
135 | Reads the `aria-label` and doesn't read the normal `label`.
136 |
137 |
138 |
139 | Please enter Make and Model
140 |
141 | ```html
142 |
143 |
144 | Please enter Make and Model
145 | ```
146 |
147 | **Screen reader reads input as:** `Car, please enter make and model Edit text`
148 |
149 |
150 | #### With aria-labelledby pointing at `carmakedescription`
151 |
152 | Reads only the `aria-labelledby` attribute and not the default label
153 |
154 |
155 |
156 | Please enter Make and Model
157 |
158 | ```html
159 |
160 |
161 | Please enter Make and Model
162 | ```
163 |
164 | **Screen reader reads input as:** `Please enter Make and Model Edit text`
165 |
166 |
167 | #### With aria-labelledby pointing at `carlabel carmakedescription`
168 |
169 | Reads both labels indicated by the `aria-labelledby` attribute
170 |
171 |
172 |
173 | Please enter Make and Model
174 |
175 | ```html
176 |
177 |
178 | Please enter Make and Model
179 | ```
180 |
181 | **Screen reader reads input as:** `Car Please enter Make and Model Edit text`
182 |
183 |
184 | #### With aria-describedby pointing at `carmakedescription`
185 |
186 | JAWS reads both the label and the description. So does VoiceOver, but there is a slight delay before it reads the description.
187 |
188 |
189 |
190 | Please enter Make and Model
191 |
192 | ```html
193 |
194 |
195 | Please enter Make and Model
196 | ```
197 |
198 | **Screen reader reads input as:** `Car Edit text Please enter Make and Model`
199 |
200 |
--------------------------------------------------------------------------------
`, but never `` to ``).
17 |
18 | For logos that are text-based, use `` element.
19 |
20 | If your logo is an image and acting as the main heading of the page, add an `` element for its text and use a `sr-only` rule so it's visibly hidden but accessible to screen reader users.
21 |
22 | The following code snippet shows one example of proper section and subsection heading hierarchy.
23 |
24 | ```html
25 | Section
26 | lorum ipsum
27 | Sub Section
28 | lorum ipsum
29 | ```
30 |
31 | ## Testing
32 |
33 | 1. Identify visual 'heading' elements
34 | 2. Check that all visual 'heading' elements use an `` tag
35 | 3. Verify that all sub heading elements have a higher number
36 |
37 | ## Examples
38 |
39 | ### Passes
40 |
41 |
42 | Category
43 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
44 | Sub Category 1
45 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
46 | Sub Category 2
47 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
48 |
49 |
50 | ```html
51 |
52 | Category
53 |
54 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
55 | Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam.
56 | Donec lobortis diam a ligula faucibus mattis.
57 |
58 | Sub category 1
59 |
60 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
61 | Nam sit amet auctor lectus. Curabitur non est nibh.
62 | Suspendisse vehicula fermentum quam.
63 | Donec lobortis diam a ligula faucibus mattis.
64 |
65 | Sub category 2
66 |
67 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
68 | Nam sit amet auctor lectus. Curabitur non est nibh.
69 | Suspendisse vehicula fermentum quam.
70 | Donec lobortis diam a ligula faucibus mattis.
71 |
72 |
73 | ```
74 |
75 | > This section has a main category and two sub categories. The sub categories are on the same level and as such use the the same heading element.
76 |
77 | ### Fails
78 |
79 |
80 | Category
81 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
82 | Sub Category 1
83 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
84 | Sub Category 2
85 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
86 |
87 |
88 | ```html
89 |
90 | Category
91 |
92 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
93 | Nam sit amet auctor lectus. Curabitur non est nibh.
94 | Suspendisse vehicula fermentum quam.
95 | Donec lobortis diam a ligula faucibus mattis.
96 |
97 | Sub category 1
98 |
99 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
100 | Nam sit amet auctor lectus. Curabitur non est nibh.
101 | Suspendisse vehicula fermentum quam.
102 | Donec lobortis diam a ligula faucibus mattis.
103 |
104 | Sub category 2
105 |
106 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
107 | Nam sit amet auctor lectus. Curabitur non est nibh.
108 | Suspendisse vehicula fermentum quam.
109 | Donec lobortis diam a ligula faucibus mattis.
110 |
111 |
112 | ```
113 |
114 | > This section has several issues. The first sub category has a lower value than the main category. The second sub category has skipped a heading level which while is better, this can cause confusion as it's not clear if this category is the sub category of `Category` or `Sub category 1`
115 |
--------------------------------------------------------------------------------
/_includes/components/header.html:
--------------------------------------------------------------------------------
1 | {% if header %}
2 |
3 | {% if header.type == 'basic' %}
4 |
5 | {% elsif header.type == 'basic-mega' %}
6 |
7 | {% elsif header.type == 'extended' or header.type == 'extended-mega' %}
8 |
9 | {% endif %}
10 |
11 | {% if header.type == 'basic' or header.type == 'basic-mega' %}
12 |
13 | {% endif %}
14 |
32 |
33 |
188 |
189 | {% if header.type == 'basic' or header.type == 'basic-mega' %}
190 |
191 | {% endif %}
192 |
193 | {% endif %}
194 |
--------------------------------------------------------------------------------
/pages/forms.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Forms
3 | description: 'How we work with forms'
4 | permalink: /forms/
5 | page_title: Forms
6 | layout: post
7 | sidenav: docs
8 | ---
9 | Making forms accessible is a simple process. Each form element should be associated with its instructions and errors, and everything should be accessible via the keyboard.
10 |
11 | ## Testing
12 |
13 | 1. Identify each form element.
14 | 2. Find all instructions associated with each element.
15 | * __It is a failure if a form element isn't programmatically associated with _all_ instructions. This includes legends, labels, hint text and tooltips.__
16 | * A common way of achieving this is using `fieldset` and `legend` tags. `Fieldset` is used to group a set of elements. `Legend` is the first child of a `fieldset` tag and provides context for those fields.
17 | 3. Ensure all field elements are accessible via the keyboard.
18 | * __If the form cannot be filled out with just a keyboard, this is a failure.__
19 | 4. Check for title attributes
20 | * Title attributes can be a substitute for labels.
21 | * __If the title attributes provides all the related information it passes, if it provides extra information it fails.__
22 | * Title attributes are not accessible via keyboard.
23 |
24 | ## Examples
25 | ### Passes
26 |
27 |
34 |
35 |
41 |
42 |
43 | ```html
44 |
51 |
52 |
58 | ```
59 | > ___Name:___ Each form element has a ```label```, and it's associated with the ```for``` attribute. The ```for``` attribute refers to the ```id``` of the ```input```. When looking at this form, 'First' and 'Last' wouldn't make sense without 'Name.' This is associated with the ```fieldset``` and ```legend```. All elements are wrapped in a ```fieldset```. There can only be one ```legend``` tag per ```fieldset```. Anything in the ```legend``` tag will be associated.
60 |
61 | > ___Favorite Soup:___ ```Fieldset``` and ```legend``` is often used for radio buttons as its the easiest way to associate the radio buttons with the question. Notice there are no ```label```s for the radio buttons, but each button has a ```title``` attribute for assistive technology to read.
62 |
63 | ### Fails
64 |
65 |
72 |
73 |
80 |
81 |
82 | ```html
83 |
90 |
91 |
98 |
99 | ```
100 |
101 | > ___Failure:___ First name label ```for``` and ```id``` don't match.
102 |
103 | > ___Failure:___ "This Question Is Required" is not associated with the form fields.
104 |
105 | > ___Failure:___ The ```title``` tag for Pea Soup indicates it's 'Chick Pea Soup.' This information is not available to keyboard, sighted users.
106 |
107 |
108 | ### How ARIA affects form inputs
109 |
110 | Screen readers vary on what they read and the additional information they provide by default. This is a broad summary of what is read based on VoiceOver for Mac OSX.
111 |
112 | You can test these with your own screen reader. If you have a OSX you can turn VoiceOver on by hitting command+F5.
113 |
114 | **Further information** Using `aria-label` or `aria-labelledby` will cause a screen reader to only read them and not the default label. If you want an input to read from multiple things like an error message, use `aria-labelledby` and pass it the `for` attribute of the label and any additional `id`s you want read. ex. `aria-labelledby='car1 car_description car-error-message'`
115 |
116 | #### No ARIA
117 |
118 | Reads just the `label` and not the description
119 |
120 |
121 |
122 | Please enter Make and Model
123 |
124 | ```html
125 |
126 |
127 | Please enter Make and Model
128 | ```
129 |
130 | **Screen reader reads input as:** `Car Edit text`
131 |
132 |
133 | #### With aria-label
134 |
135 | Reads the `aria-label` and doesn't read the normal `label`.
136 |
137 |
138 |
139 | Please enter Make and Model
140 |
141 | ```html
142 |
143 |
144 | Please enter Make and Model
145 | ```
146 |
147 | **Screen reader reads input as:** `Car, please enter make and model Edit text`
148 |
149 |
150 | #### With aria-labelledby pointing at `carmakedescription`
151 |
152 | Reads only the `aria-labelledby` attribute and not the default label
153 |
154 |
155 |
156 | Please enter Make and Model
157 |
158 | ```html
159 |
160 |
161 | Please enter Make and Model
162 | ```
163 |
164 | **Screen reader reads input as:** `Please enter Make and Model Edit text`
165 |
166 |
167 | #### With aria-labelledby pointing at `carlabel carmakedescription`
168 |
169 | Reads both labels indicated by the `aria-labelledby` attribute
170 |
171 |
172 |
173 | Please enter Make and Model
174 |
175 | ```html
176 |
177 |
178 | Please enter Make and Model
179 | ```
180 |
181 | **Screen reader reads input as:** `Car Please enter Make and Model Edit text`
182 |
183 |
184 | #### With aria-describedby pointing at `carmakedescription`
185 |
186 | JAWS reads both the label and the description. So does VoiceOver, but there is a slight delay before it reads the description.
187 |
188 |
189 |
190 | Please enter Make and Model
191 |
192 | ```html
193 |
194 |
195 | Please enter Make and Model
196 | ```
197 |
198 | **Screen reader reads input as:** `Car Edit text Please enter Make and Model`
199 |
200 |
--------------------------------------------------------------------------------
`).
17 |
18 | For logos that are text-based, use `` element.
19 |
20 | If your logo is an image and acting as the main heading of the page, add an `` element for its text and use a `sr-only` rule so it's visibly hidden but accessible to screen reader users.
21 |
22 | The following code snippet shows one example of proper section and subsection heading hierarchy.
23 |
24 | ```html
25 | Section
26 | lorum ipsum
27 | Sub Section
28 | lorum ipsum
29 | ```
30 |
31 | ## Testing
32 |
33 | 1. Identify visual 'heading' elements
34 | 2. Check that all visual 'heading' elements use an `` tag
35 | 3. Verify that all sub heading elements have a higher number
36 |
37 | ## Examples
38 |
39 | ### Passes
40 |
41 |
42 | Category
43 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
44 | Sub Category 1
45 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
46 | Sub Category 2
47 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
48 |
49 |
50 | ```html
51 |
52 | Category
53 |
54 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
55 | Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam.
56 | Donec lobortis diam a ligula faucibus mattis.
57 |
58 | Sub category 1
59 |
60 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
61 | Nam sit amet auctor lectus. Curabitur non est nibh.
62 | Suspendisse vehicula fermentum quam.
63 | Donec lobortis diam a ligula faucibus mattis.
64 |
65 | Sub category 2
66 |
67 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
68 | Nam sit amet auctor lectus. Curabitur non est nibh.
69 | Suspendisse vehicula fermentum quam.
70 | Donec lobortis diam a ligula faucibus mattis.
71 |
72 |
73 | ```
74 |
75 | > This section has a main category and two sub categories. The sub categories are on the same level and as such use the the same heading element.
76 |
77 | ### Fails
78 |
79 |
80 | Category
81 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
82 | Sub Category 1
83 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
84 | Sub Category 2
85 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
86 |
87 |
88 | ```html
89 |
90 | Category
91 |
92 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
93 | Nam sit amet auctor lectus. Curabitur non est nibh.
94 | Suspendisse vehicula fermentum quam.
95 | Donec lobortis diam a ligula faucibus mattis.
96 |
97 | Sub category 1
98 |
99 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
100 | Nam sit amet auctor lectus. Curabitur non est nibh.
101 | Suspendisse vehicula fermentum quam.
102 | Donec lobortis diam a ligula faucibus mattis.
103 |
104 | Sub category 2
105 |
106 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
107 | Nam sit amet auctor lectus. Curabitur non est nibh.
108 | Suspendisse vehicula fermentum quam.
109 | Donec lobortis diam a ligula faucibus mattis.
110 |
111 |
112 | ```
113 |
114 | > This section has several issues. The first sub category has a lower value than the main category. The second sub category has skipped a heading level which while is better, this can cause confusion as it's not clear if this category is the sub category of `Category` or `Sub category 1`
115 |
--------------------------------------------------------------------------------
/_includes/components/header.html:
--------------------------------------------------------------------------------
1 | {% if header %}
2 |
3 | {% if header.type == 'basic' %}
4 |
5 | {% elsif header.type == 'basic-mega' %}
6 |
7 | {% elsif header.type == 'extended' or header.type == 'extended-mega' %}
8 |
9 | {% endif %}
10 |
11 | {% if header.type == 'basic' or header.type == 'basic-mega' %}
12 |
13 | {% endif %}
14 |
32 |
33 |
188 |
189 | {% if header.type == 'basic' or header.type == 'basic-mega' %}
190 |
191 | {% endif %}
192 |
193 | {% endif %}
194 |
--------------------------------------------------------------------------------
/pages/forms.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Forms
3 | description: 'How we work with forms'
4 | permalink: /forms/
5 | page_title: Forms
6 | layout: post
7 | sidenav: docs
8 | ---
9 | Making forms accessible is a simple process. Each form element should be associated with its instructions and errors, and everything should be accessible via the keyboard.
10 |
11 | ## Testing
12 |
13 | 1. Identify each form element.
14 | 2. Find all instructions associated with each element.
15 | * __It is a failure if a form element isn't programmatically associated with _all_ instructions. This includes legends, labels, hint text and tooltips.__
16 | * A common way of achieving this is using `fieldset` and `legend` tags. `Fieldset` is used to group a set of elements. `Legend` is the first child of a `fieldset` tag and provides context for those fields.
17 | 3. Ensure all field elements are accessible via the keyboard.
18 | * __If the form cannot be filled out with just a keyboard, this is a failure.__
19 | 4. Check for title attributes
20 | * Title attributes can be a substitute for labels.
21 | * __If the title attributes provides all the related information it passes, if it provides extra information it fails.__
22 | * Title attributes are not accessible via keyboard.
23 |
24 | ## Examples
25 | ### Passes
26 |
27 |
34 |
35 |
41 |
42 |
43 | ```html
44 |
51 |
52 |
58 | ```
59 | > ___Name:___ Each form element has a ```label```, and it's associated with the ```for``` attribute. The ```for``` attribute refers to the ```id``` of the ```input```. When looking at this form, 'First' and 'Last' wouldn't make sense without 'Name.' This is associated with the ```fieldset``` and ```legend```. All elements are wrapped in a ```fieldset```. There can only be one ```legend``` tag per ```fieldset```. Anything in the ```legend``` tag will be associated.
60 |
61 | > ___Favorite Soup:___ ```Fieldset``` and ```legend``` is often used for radio buttons as its the easiest way to associate the radio buttons with the question. Notice there are no ```label```s for the radio buttons, but each button has a ```title``` attribute for assistive technology to read.
62 |
63 | ### Fails
64 |
65 |
72 |
73 |
80 |
81 |
82 | ```html
83 |
90 |
91 |
98 |
99 | ```
100 |
101 | > ___Failure:___ First name label ```for``` and ```id``` don't match.
102 |
103 | > ___Failure:___ "This Question Is Required" is not associated with the form fields.
104 |
105 | > ___Failure:___ The ```title``` tag for Pea Soup indicates it's 'Chick Pea Soup.' This information is not available to keyboard, sighted users.
106 |
107 |
108 | ### How ARIA affects form inputs
109 |
110 | Screen readers vary on what they read and the additional information they provide by default. This is a broad summary of what is read based on VoiceOver for Mac OSX.
111 |
112 | You can test these with your own screen reader. If you have a OSX you can turn VoiceOver on by hitting command+F5.
113 |
114 | **Further information** Using `aria-label` or `aria-labelledby` will cause a screen reader to only read them and not the default label. If you want an input to read from multiple things like an error message, use `aria-labelledby` and pass it the `for` attribute of the label and any additional `id`s you want read. ex. `aria-labelledby='car1 car_description car-error-message'`
115 |
116 | #### No ARIA
117 |
118 | Reads just the `label` and not the description
119 |
120 |
121 |
122 | Please enter Make and Model
123 |
124 | ```html
125 |
126 |
127 | Please enter Make and Model
128 | ```
129 |
130 | **Screen reader reads input as:** `Car Edit text`
131 |
132 |
133 | #### With aria-label
134 |
135 | Reads the `aria-label` and doesn't read the normal `label`.
136 |
137 |
138 |
139 | Please enter Make and Model
140 |
141 | ```html
142 |
143 |
144 | Please enter Make and Model
145 | ```
146 |
147 | **Screen reader reads input as:** `Car, please enter make and model Edit text`
148 |
149 |
150 | #### With aria-labelledby pointing at `carmakedescription`
151 |
152 | Reads only the `aria-labelledby` attribute and not the default label
153 |
154 |
155 |
156 | Please enter Make and Model
157 |
158 | ```html
159 |
160 |
161 | Please enter Make and Model
162 | ```
163 |
164 | **Screen reader reads input as:** `Please enter Make and Model Edit text`
165 |
166 |
167 | #### With aria-labelledby pointing at `carlabel carmakedescription`
168 |
169 | Reads both labels indicated by the `aria-labelledby` attribute
170 |
171 |
172 |
173 | Please enter Make and Model
174 |
175 | ```html
176 |
177 |
178 | Please enter Make and Model
179 | ```
180 |
181 | **Screen reader reads input as:** `Car Please enter Make and Model Edit text`
182 |
183 |
184 | #### With aria-describedby pointing at `carmakedescription`
185 |
186 | JAWS reads both the label and the description. So does VoiceOver, but there is a slight delay before it reads the description.
187 |
188 |
189 |
190 | Please enter Make and Model
191 |
192 | ```html
193 |
194 |
195 | Please enter Make and Model
196 | ```
197 |
198 | **Screen reader reads input as:** `Car Edit text Please enter Make and Model`
199 |
200 |
--------------------------------------------------------------------------------
Section
26 | lorum ipsum 27 |Sub Section
28 | lorum ipsum 29 | ``` 30 | 31 | ## Testing 32 | 33 | 1. Identify visual 'heading' elements 34 | 2. Check that all visual 'heading' elements use an `Category
43 |Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
44 |Sub Category 1
45 |Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
46 |Sub Category 2
47 |Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
48 |Category
53 |54 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. 55 | Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. 56 | Donec lobortis diam a ligula faucibus mattis. 57 |
58 |Sub category 1
59 |60 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. 61 | Nam sit amet auctor lectus. Curabitur non est nibh. 62 | Suspendisse vehicula fermentum quam. 63 | Donec lobortis diam a ligula faucibus mattis. 64 |
65 |Sub category 2
66 |67 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. 68 | Nam sit amet auctor lectus. Curabitur non est nibh. 69 | Suspendisse vehicula fermentum quam. 70 | Donec lobortis diam a ligula faucibus mattis. 71 |
72 |Category
81 |Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
82 |Sub Category 1
83 |Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
84 |Sub Category 2
85 |Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet auctor lectus. Curabitur non est nibh. Suspendisse vehicula fermentum quam. Donec lobortis diam a ligula faucibus mattis.
86 |Category
91 |92 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. 93 | Nam sit amet auctor lectus. Curabitur non est nibh. 94 | Suspendisse vehicula fermentum quam. 95 | Donec lobortis diam a ligula faucibus mattis. 96 |
97 |Sub category 1
98 |99 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. 100 | Nam sit amet auctor lectus. Curabitur non est nibh. 101 | Suspendisse vehicula fermentum quam. 102 | Donec lobortis diam a ligula faucibus mattis. 103 |
104 |Sub category 2
105 |106 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. 107 | Nam sit amet auctor lectus. Curabitur non est nibh. 108 | Suspendisse vehicula fermentum quam. 109 | Donec lobortis diam a ligula faucibus mattis. 110 |
111 |42 | 43 | ```html 44 | 51 | 52 | 58 | ``` 59 | > ___Name:___ Each form element has a ```label```, and it's associated with the ```for``` attribute. The ```for``` attribute refers to the ```id``` of the ```input```. When looking at this form, 'First' and 'Last' wouldn't make sense without 'Name.' This is associated with the ```fieldset``` and ```legend```. All elements are wrapped in a ```fieldset```. There can only be one ```legend``` tag per ```fieldset```. Anything in the ```legend``` tag will be associated. 60 | 61 | > ___Favorite Soup:___ ```Fieldset``` and ```legend``` is often used for radio buttons as its the easiest way to associate the radio buttons with the question. Notice there are no ```label```s for the radio buttons, but each button has a ```title``` attribute for assistive technology to read. 62 | 63 | ### Fails 64 | 65 | 72 | 73 | 80 |
81 | 82 | ```html 83 | 90 | 91 | 98 |
99 | ``` 100 | 101 | > ___Failure:___ First name label ```for``` and ```id``` don't match. 102 | 103 | > ___Failure:___ "This Question Is Required" is not associated with the form fields. 104 | 105 | > ___Failure:___ The ```title``` tag for Pea Soup indicates it's 'Chick Pea Soup.' This information is not available to keyboard, sighted users. 106 | 107 | 108 | ### How ARIA affects form inputs 109 | 110 | Screen readers vary on what they read and the additional information they provide by default. This is a broad summary of what is read based on VoiceOver for Mac OSX. 111 | 112 | You can test these with your own screen reader. If you have a OSX you can turn VoiceOver on by hitting command+F5. 113 | 114 | **Further information** Using `aria-label` or `aria-labelledby` will cause a screen reader to only read them and not the default label. If you want an input to read from multiple things like an error message, use `aria-labelledby` and pass it the `for` attribute of the label and any additional `id`s you want read. ex. `aria-labelledby='car1 car_description car-error-message'` 115 | 116 | #### No ARIA 117 | 118 | Reads just the `label` and not the description 119 | 120 | 121 |
122 | Please enter Make and Model 123 | 124 | ```html 125 | 126 |
127 | Please enter Make and Model 128 | ``` 129 | 130 | **Screen reader reads input as:** `Car Edit text` 131 |
132 | 133 | #### With aria-label 134 | 135 | Reads the `aria-label` and doesn't read the normal `label`. 136 | 137 | 138 |
139 | Please enter Make and Model 140 | 141 | ```html 142 | 143 |
144 | Please enter Make and Model 145 | ``` 146 | 147 | **Screen reader reads input as:** `Car, please enter make and model Edit text` 148 |
149 | 150 | #### With aria-labelledby pointing at `carmakedescription` 151 | 152 | Reads only the `aria-labelledby` attribute and not the default label 153 | 154 | 155 |
156 | Please enter Make and Model 157 | 158 | ```html 159 | 160 |
161 | Please enter Make and Model 162 | ``` 163 | 164 | **Screen reader reads input as:** `Please enter Make and Model Edit text` 165 |
166 | 167 | #### With aria-labelledby pointing at `carlabel carmakedescription` 168 | 169 | Reads both labels indicated by the `aria-labelledby` attribute 170 | 171 | 172 |
173 | Please enter Make and Model 174 | 175 | ```html 176 | 177 |
178 | Please enter Make and Model 179 | ``` 180 | 181 | **Screen reader reads input as:** `Car Please enter Make and Model Edit text` 182 |
183 | 184 | #### With aria-describedby pointing at `carmakedescription` 185 | 186 | JAWS reads both the label and the description. So does VoiceOver, but there is a slight delay before it reads the description. 187 | 188 | 189 |
190 | Please enter Make and Model 191 | 192 | ```html 193 | 194 |
195 | Please enter Make and Model 196 | ``` 197 | 198 | **Screen reader reads input as:** `Car Edit text Please enter Make and Model` 199 |
200 | --------------------------------------------------------------------------------
32 |
33 | ```html
34 |