Skip to content

Commit af70bf1

Browse files
committed
Update forms so that assistive technology users can use them
1 parent 07f1a59 commit af70bf1

File tree

5 files changed

+24
-24
lines changed

5 files changed

+24
-24
lines changed

src/components/forms/checkbox-list.html

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,32 @@
88
<fieldset id="favorite_movies" class="bn">
99
<legend class="fw7 mb2">Favorite Movies</legend>
1010
<div class="flex items-center mb2">
11-
<input class="mr2" type="checkbox" value="spacejam">
12-
<label class="lh-copy">Space Jam</label>
11+
<input class="mr2" type="checkbox" id="spacejam" value="spacejam">
12+
<label for="spacejam" class="lh-copy">Space Jam</label>
1313
</div>
1414
<div class="flex items-center mb2">
15-
<input class="mr2" type="checkbox" value="airbud">
16-
<label class="lh-copy">Air Bud</label>
15+
<input class="mr2" type="checkbox" id="airbud" value="airbud">
16+
<label for="airbud" class="lh-copy">Air Bud</label>
1717
</div>
1818
<div class="flex items-center mb2">
19-
<input class="mr2" type="checkbox" value="hocuspocus">
20-
<label class="lh-copy">Hocus Pocus</label>
19+
<input class="mr2" type="checkbox" id="hocuspocus" value="hocuspocus">
20+
<label for="hocuspocus" class="lh-copy">Hocus Pocus</label>
2121
</div>
2222
<div class="flex items-center mb2">
23-
<input class="mr2" type="checkbox" value="diehard">
24-
<label class="lh-copy">Die Hard</label>
23+
<input class="mr2" type="checkbox" id="diehard" value="diehard">
24+
<label for="diehard" class="lh-copy">Die Hard</label>
2525
</div>
2626
<div class="flex items-center mb2">
27-
<input class="mr2" type="checkbox" value="primer">
28-
<label class="lh-copy">Primer</label>
27+
<input class="mr2" type="checkbox" id="primer" value="primer">
28+
<label for="primer" class="lh-copy">Primer</label>
2929
</div>
3030
<div class="flex items-center mb2">
31-
<input class="mr2" type="checkbox" value="proxy">
32-
<label class="lh-copy">Hudsucker Proxy</label>
31+
<input class="mr2" type="checkbox" id="proxy" value="proxy">
32+
<label for="proxy" class="lh-copy">Hudsucker Proxy</label>
3333
</div>
3434
<div class="flex items-center mb2">
35-
<input class="mr2" type="checkbox" value="homealone">
36-
<label class="lh-copy">Home Alone</label>
35+
<input class="mr2" type="checkbox" id="homealone" value="homealone">
36+
<label for="homealone" class="lh-copy">Home Alone</label>
3737
</div>
3838
</fieldset>
3939
</form>

src/components/forms/input-text-label.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
}}}
88
<form class="pa4 black-80">
99
<div class="measure">
10-
<label for="comment" class="f6 b db mb2">Name <span class="normal black-60">(optional)</span></label>
11-
<input class="input-reset ba b--black-20 pa2 mb2 db w-100" type="text">
12-
<small class="f6 black-60 db mb2">Helper text for the form control.</small>
10+
<label for="name" class="f6 b db mb2">Name <span class="normal black-60">(optional)</span></label>
11+
<input id="name" class="input-reset ba b--black-20 pa2 mb2 db w-100" type="text" aria-describedby="name-desc">
12+
<small id="name-desc" class="f6 black-60 db mb2">Helper text for the form control.</small>
1313
</div>
1414
</form>

src/components/forms/newsletter-subscription.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
<fieldset class="cf bn ma0 pa0">
1010
<legend class="pa0 f5 f4-ns mb3 black-80">Sign up for our newsletter</legend>
1111
<div class="cf">
12-
<input class="f6 f5-l input-reset bn fl black-80 bg-white pa3 lh-solid w-100 w-75-m w-80-l br2-ns br--left-ns" placeholder="Your Email Address" type="text" name="Email_Adress" value="" id="Email_Adress">
12+
<label class="clip" for="email-address">Email Address</label>
13+
<input class="f6 f5-l input-reset bn fl black-80 bg-white pa3 lh-solid w-100 w-75-m w-80-l br2-ns br--left-ns" placeholder="Your Email Address" type="text" name="email-address" value="" id="email-address">
1314
<input class="f6 f5-l button-reset fl pv3 tc bn bg-animate bg-black-70 hover-bg-black white pointer w-100 w-25-m w-20-l br2-ns br--right-ns" type="submit" value="Subscribe">
1415
</div>
1516
</fieldset>
1617
</form>
1718
</div>
18-

src/components/forms/password.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
}}}
77
<form class="pa4 black-80">
88
<div class="measure-narrow">
9-
<label for="" class="f6 b db mb2">Password</label>
10-
<input class="input-reset ba b--black-20 pa2 mb2 db w-100" type="password">
11-
<small class="f6 lh-copy black-60 db mb2">
9+
<label for="password" class="f6 b db mb2">Password</label>
10+
<input class="input-reset ba b--black-20 pa2 mb2 db w-100" type="password" id="password" aria-describedby="password-desc">
11+
<small id="password-desc" class="f6 lh-copy black-60 db mb2">
1212
Must be 9 characters long and contain both a number and an uppercase
1313
character.
1414
</small>

src/components/forms/textarea-label.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<form class="pa4 black-80">
88
<div>
99
<label for="comment" class="f6 b db mb2">Comments <span class="normal black-60">(optional)</span></label>
10-
<textarea name="comment" class="db border-box hover-black w-100 measure ba b--black-20 pa2 br2 mb2"></textarea>
11-
<small class="f6 black-60">Helper text for a form control. Can use this text to <a href="#" class="link underline black-80 hover-blue">link to more info.</a></small>
10+
<textarea id="comment" name="comment" class="db border-box hover-black w-100 measure ba b--black-20 pa2 br2 mb2" aria-describedby="comment-desc"></textarea>
11+
<small id="comment-desc" class="f6 black-60">Helper text for a form control. Can use this text to <a href="#" class="link underline black-80 hover-blue">link to more info.</a></small>
1212
</div>
1313
</form>

0 commit comments

Comments
 (0)