|
1 | 1 | <!DOCTYPE html> |
2 | 2 | <html lang="en"> |
3 | 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 | | - <link rel="stylesheet" href="main.css"> |
10 | | - |
| 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 | + <link rel="stylesheet" href="main.css"> |
| 10 | + <link rel="preconnect" href="https://fonts.googleapis.com"> |
| 11 | + <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> |
| 12 | + <link href="https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap" rel="stylesheet"> |
| 13 | + <link href="https://fonts.googleapis.com/css2?family=Pinyon+Script&display=swap" rel="stylesheet"> |
11 | 14 | </head> |
12 | 15 | <body> |
13 | 16 | <header> |
14 | | - <div class="container"> |
15 | 17 | <h1>Product Pick</h1> |
16 | | - </div> |
17 | 18 | </header> |
18 | | -<main> |
19 | | - <div class="container"> |
20 | | - <form> |
21 | | - <!-- write your html here--> |
22 | | - <!-- |
23 | | - try writing out the requirements first as comments |
24 | | - this will also help you fill in your PR message later--> |
25 | 19 |
|
26 | | - <!-- first and lastname (ensure it contains at least two non-space characters.)--> |
27 | | - <!-- email (make sure the email is valid. Email addresses follow a consistent pattern.)--> |
28 | | - <!-- shirt color (I must provide 3 options. How will I ensure they do not choose other colors?)--> |
29 | | - <!-- shirt size (must provide the following 6 options: XS, S, M, L, XL, XXL)--> |
| 20 | +<form> |
| 21 | + <!-- write your HTML here--> |
| 22 | + <!-- |
| 23 | + try writing out the requirements first as comments |
| 24 | + this will also help you fill in your PR message later--> |
| 25 | + |
| 26 | + <!-- first and lastname (ensure it contains at least two non-space characters.)--> |
| 27 | + <!-- email (make sure the email is valid. Email addresses follow a consistent pattern.)--> |
| 28 | + <!-- shirt color (I must provide 3 options. How will I ensure they do not choose other colors?)--> |
| 29 | + <!-- shirt size (must provide the following 6 options: XS, S, M, L, XL, XXL)--> |
30 | 30 |
|
31 | 31 |
|
32 | | - <div class="form-group"> |
33 | | - <label for="firstname">First Name</label> |
| 32 | + <div class="form-group"> |
| 33 | + <label for="firstname">First Name </label> |
34 | 34 | <input |
35 | 35 | type="text" |
36 | 36 | id="firstname" |
37 | 37 | name="firstname" |
38 | 38 | required |
39 | | - pattern="" |
40 | | - title="" |
41 | | - > |
42 | | - </div> |
| 39 | + pattern="^[A-Za-z\s'-]{2,}$" |
| 40 | + title="first name must be more than 2 characters"> |
| 41 | + </div> |
43 | 42 |
|
44 | | - <div class="form-group"> |
| 43 | + <div class="form-group"> |
45 | 44 | <label for="lastname">Last Name</label> |
46 | 45 | <input |
47 | 46 | type="text" |
48 | 47 | id="lastname" |
49 | 48 | name="lastname" |
50 | 49 | required |
51 | | - pattern="" |
52 | | - title=""> |
53 | | - </div> |
| 50 | + pattern="^[A-Za-z\s'-]{2,}$" |
| 51 | + title="last name must be more than 2 characters"> |
| 52 | + </div> |
54 | 53 |
|
55 | | - <div class="form-group"> |
| 54 | + <div class="form-group"> |
56 | 55 | <label for="email">Email</label> |
57 | 56 | <input |
58 | 57 | type="email" |
59 | 58 | id="email" |
60 | 59 | name="email" |
61 | | - required |
62 | | - pattern="" |
63 | | - title=""> |
64 | | - </div> |
| 60 | + required> |
65 | 61 |
|
66 | | - <div class="form-group"> |
| 62 | + </div> |
| 63 | + |
| 64 | + <div class="form-group"> |
67 | 65 | <fieldset> |
68 | | - <legend>Choose a shirt color:</legend> |
69 | | - <div class="form-group-fieldset"> |
70 | | - <input |
71 | | - type="radio" |
72 | | - id="choice1" |
73 | | - name="shirt" |
74 | | - value="blue" |
75 | | - > |
76 | | - <label for="choice1">Blue</label> |
77 | | - </div> |
| 66 | + <legend>Choose a shirt color:</legend> |
| 67 | + <div class="form-group-fieldset"> |
| 68 | + <input |
| 69 | + type="radio" |
| 70 | + id="choice1" |
| 71 | + name="shirt" |
| 72 | + value="blue" |
| 73 | + required> |
| 74 | + <label for="choice1">Blue</label> |
| 75 | + </div> |
78 | 76 |
|
79 | | - <div class="form-group-fieldset"> |
80 | | - <input |
81 | | - type="radio" |
82 | | - id="choice2" |
83 | | - name="shirt" |
84 | | - value="green" |
85 | | - > |
86 | | - <label for="choice2">Green</label> |
87 | | - </div> |
| 77 | + <div class="form-group-fieldset"> |
| 78 | + <input |
| 79 | + type="radio" |
| 80 | + id="choice2" |
| 81 | + name="shirt" |
| 82 | + value="green" |
| 83 | + > |
| 84 | + <label for="choice2">Green</label> |
| 85 | + </div> |
88 | 86 |
|
89 | | - <div class="form-group-fieldset"> |
90 | | - <input |
91 | | - type="radio" |
92 | | - id="choice3" |
93 | | - name="shirt" |
94 | | - value="yellow" |
95 | | - > |
96 | | - <label for="choice3">Yellow</label> |
97 | | - </div> |
| 87 | + <div class="form-group-fieldset"> |
| 88 | + <input |
| 89 | + type="radio" |
| 90 | + id="choice3" |
| 91 | + name="shirt" |
| 92 | + value="yellow" |
| 93 | + > |
| 94 | + <label for="choice3">Yellow</label> |
| 95 | + </div> |
98 | 96 | </fieldset> |
99 | | - </div> |
| 97 | + </div> |
100 | 98 |
|
101 | | - <div class="form-group"> |
| 99 | + <div class="form-group"> |
102 | 100 | <label for="sizing">Choose a size:</label> |
103 | | - <select id="sizing" name="size"> |
104 | | - <option value="">--Please choose an option--</option> |
105 | | - <option value="ex-small">XS</option> |
106 | | - <option value="small">S</option> |
107 | | - <option value="medium">M</option> |
108 | | - <option value="large">L</option> |
109 | | - <option value="ex-large">XL</option> |
110 | | - <option value="ex-ex-large">XXL</option> |
| 101 | + <select id="sizing" name="size" required> |
| 102 | + <option value="">--Please choose an option--</option> |
| 103 | + <option value="ex-small">XS</option> |
| 104 | + <option value="small">S</option> |
| 105 | + <option value="medium">M</option> |
| 106 | + <option value="large">L</option> |
| 107 | + <option value="ex-large">XL</option> |
| 108 | + <option value="ex-ex-large">XXL</option> |
111 | 109 |
|
112 | 110 | </select> |
113 | | - </div> |
114 | | - <button>Submit</button> |
115 | | - </form> |
116 | | - </div> |
117 | | -</main> |
| 111 | + </div> |
| 112 | + <button type="submit">Submit</button> |
| 113 | +</form> |
118 | 114 |
|
119 | 115 | <footer> |
120 | | - <!-- change to your name--> |
121 | | - <div class="container"> |
| 116 | + <!-- change to your name--> |
122 | 117 | <p>By DAMILOLA ODUMOSU</p> |
123 | | - </div> |
124 | 118 | </footer> |
125 | 119 | </body> |
126 | 120 | </html> |
127 | 121 |
|
| 122 | + |
0 commit comments