Skip to content

Commit 9fd0f22

Browse files
committed
order form with validation and accessibility
1 parent 3725052 commit 9fd0f22

File tree

1 file changed

+66
-25
lines changed

1 file changed

+66
-25
lines changed

Form-Controls/index.html

Lines changed: 66 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,68 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
3-
<head>
4-
<meta charset="utf-8" />
5-
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6-
<title>My form exercise</title>
7-
<meta name="description" content="" />
8-
<meta name="viewport" content="width=device-width, initial-scale=1" />
9-
</head>
10-
<body>
11-
<header>
12-
<h1>Product Pick</h1>
13-
</header>
14-
<main>
15-
<form>
16-
<!-- write your html here-->
17-
<!--
18-
try writing out the requirements first as comments
19-
this will also help you fill in your PR message later-->
20-
</form>
21-
</main>
22-
<footer>
23-
<!-- change to your name-->
24-
<p>By HOMEWORK SOLUTION</p>
25-
</footer>
26-
</body>
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<title>My form exercise</title>
7+
<meta name="description" content="" />
8+
<meta name="viewport" content="width=device-width, initial-scale=1" />
9+
</head>
10+
<body>
11+
<header>
12+
<h1>Product Pick</h1>
13+
</header>
14+
<main>
15+
<form aria-label="order form">
16+
<label for="name">name: </label>
17+
<input
18+
type="text"
19+
name="name"
20+
id="name"
21+
minlength="2"
22+
maxlength="100"
23+
autocomplete="name"
24+
pattern="[a-zA-ZÀ-ÖØ-öø-ÿ'\-\s]{2,100}"
25+
aria-label="enter your name"
26+
required />
27+
28+
<label for="email">email: </label>
29+
<input
30+
type="email"
31+
name="email"
32+
id="email"
33+
aria-label="enter your email address"
34+
required />
35+
36+
<label for="shirt-color">shirt color: </label>
37+
<select
38+
name="shirt-color"
39+
id="shirt-color"
40+
aria-label="select shirt color"
41+
required>
42+
<option value="red">red</option>
43+
<option value="red">green</option>
44+
<option value="red">blue</option>
45+
</select>
46+
<select
47+
name="shirt-size"
48+
id="shirt-size"
49+
aria-label="select shirt size"
50+
required>
51+
<option value="xs">XS</option>
52+
<option value="s">S</option>
53+
<option value="m">M</option>
54+
<option value="l">L</option>
55+
<option value="xl">XL</option>
56+
<option value="xxl">XXL</option>
57+
</select>
58+
<button type="submit" aria-label="submit order">
59+
Check out
60+
</button>
61+
</form>
62+
</main>
63+
<footer>
64+
<!-- change to your name-->
65+
<p>By HOMEWORK SOLUTION</p>
66+
</footer>
67+
</body>
2768
</html>

0 commit comments

Comments
 (0)