|
1 | | -<!DOCTYPE html> |
| 1 | +<!doctype html> |
2 | 2 | <html lang="en"> |
3 | 3 | <head> |
4 | 4 | <meta charset="utf-8" /> |
5 | 5 | <meta http-equiv="X-UA-Compatible" content="IE=edge" /> |
6 | | - <title>My form exercise</title> |
7 | | - <meta name="description" content="" /> |
| 6 | + <title>T-shirt Order Form</title> |
| 7 | + <meta |
| 8 | + name="description" |
| 9 | + content="T-shirt order form for customers to place orders" |
| 10 | + /> |
8 | 11 | <meta name="viewport" content="width=device-width, initial-scale=1" /> |
| 12 | + <link rel="stylesheet" href="style.css" /> |
9 | 13 | </head> |
10 | 14 | <body> |
11 | | - <header> |
12 | | - <h1>Product Pick</h1> |
13 | | - </header> |
14 | 15 | <main> |
15 | | - <form> |
| 16 | + <form method="get" class="container"> |
| 17 | + <!-- Requirements: |
| 18 | + - What is the customer's name? I must collect this data and ensure it contains at least two non-space characters. |
| 19 | + - What is the customer's email? I must make sure the email is valid. Email addresses follow a consistent pattern. |
| 20 | + - What colour should this T-shirt be? I must provide 3 options and to ensure they do not choose other colours. |
| 21 | + - What size does the customer want? I must provide the following 6 options: XS, S, M, L, XL, XXL and to ensure they do not choose other sizes. |
| 22 | + --> |
| 23 | + <header> |
| 24 | + <h1>T-shirt Order Form</h1> |
| 25 | + </header> |
16 | 26 |
|
17 | | - <label for="name">Name:</label> |
18 | | - <input type="text" id="name" name="name" minlength="2" required ><br> |
19 | | - <label for="email">Email:</label> |
20 | | - <input type="email" id="email" name="email"><br><br> |
| 27 | + <hr /> |
| 28 | + <label for="name">Full Name</label> |
| 29 | + <input |
| 30 | + id="name" |
| 31 | + name="name" |
| 32 | + type="text" |
| 33 | + minlength="2" |
| 34 | + placeholder="First Name Surname" |
| 35 | + pattern="[\p{L} ]{2,}" |
| 36 | + required |
| 37 | + /> |
21 | 38 |
|
22 | | - <fieldset> |
23 | | - <legend>colour:</legend> |
| 39 | + <hr /> |
| 40 | + <label for="email">Email</label> |
| 41 | + <input |
| 42 | + id="email" |
| 43 | + name="email" |
| 44 | + type="email" |
| 45 | + pattern="[A-Za-z0-9._%+\-]+@[A-Za-z0-9.\-]+\.[A-Za-z]{2,}$" |
| 46 | + placeholder="Your email" |
| 47 | + required |
| 48 | + /> |
24 | 49 |
|
25 | | - <label> |
26 | | - <input type="radio" id="colour-red" name="colour" value="red" required> |
27 | | - Red |
28 | | - </label> |
29 | | - |
30 | | - <label > |
31 | | - <input type="radio" id="colour-blue" name="colour" value="blue"> |
32 | | - Blue |
33 | | - </label> |
34 | | - |
35 | | - <label > |
36 | | - <input type="radio" id="colour-green" name="colour" value="green"> |
37 | | - Green |
38 | | - </label> |
39 | | - |
40 | | - </fieldset> |
| 50 | + <hr /> |
| 51 | + <label for="colour">T-shirt Colour:</label> |
| 52 | + <select name="colour" id="colour" required> |
| 53 | + <option value="">Choose a Colour</option> |
| 54 | + <option value="Red">Red</option> |
| 55 | + <option value="Blue">Blue</option> |
| 56 | + <option value="Yellow">Yellow</option> |
| 57 | + </select> |
41 | 58 |
|
42 | | - <p for="size">Choose your size</p> |
| 59 | + <hr /> |
| 60 | + <label for="Size">T-shirt Size:</label> |
| 61 | + <select name="size" id="Size" required> |
| 62 | + <option value="">Choose a Size</option> |
| 63 | + <option value="XS">XS</option> |
| 64 | + <option value="S">S</option> |
| 65 | + <option value="M">M</option> |
| 66 | + <option value="L">L</option> |
| 67 | + <option value="XL">XL</option> |
| 68 | + <option value="XXL">XXL</option> |
| 69 | + </select> |
43 | 70 |
|
44 | | - <select id="size" name="size" required> |
45 | | - <option value="s">Small</option> |
46 | | - <option value="m">Medium</option> |
47 | | - <option value="l">Large</option> |
48 | | - <option value="xl">XLarge</option> |
49 | | - <option value="xl">XXLarge</option> |
| 71 | + <hr /> |
| 72 | + <button type="submit">Submit</button> |
50 | 73 |
|
51 | | - </select> |
| 74 | + <!-- |
| 75 | + try writing out the requirements first as comments |
| 76 | + this will also help you fill in your PR message later--> |
52 | 77 | </form> |
53 | 78 | </main> |
54 | 79 | <footer> |
55 | | - <p>Anita Amirhaeri</p> |
| 80 | + <!-- change to your name--> |
| 81 | + <p>Mahdi Rafiei</p> |
56 | 82 | </footer> |
57 | 83 | </body> |
58 | 84 | </html> |
0 commit comments