1+ <!--
2+ try writing out the requirements first as comments
3+ this will also help you fill in your PR message later-->
4+ <!--Writing that out as a series of questions to ask yourself:
5+
6+ 1. What is the customer's name? I must collect this data and ensure it contains at least two non-space characters.
7+ 2. What is the customer's email? I must make sure the email is valid. Email addresses follow a consistent pattern.
8+ 3. What colour should this T-shirt be? I must provide 3 options. How will I ensure they do not choose other colours?
9+ 4. What size does the customer want? I must provide the following 6 options: XS, S, M, L, XL, XXL
10+
11+ All fields are required.-->
12+
13+ <!DOCTYPE html>
14+ < html lang ="en ">
15+ < head >
16+ < meta charset ="utf-8 " />
17+ < meta http-equiv ="X-UA-Compatible " content ="IE=edge " />
18+ < title > My form exercise</ title >
19+ < link rel ="stylesheet " href ="style.css "/>
20+ < meta name ="description " content ="" />
21+ < meta name ="viewport " content ="width=device-width, initial-scale=1 " />
22+
23+ </ head >
24+ < body >
25+ < header >
26+ < h1 > Product Pick</ h1 >
27+ </ header >
28+ < main >
29+ < form >
30+ <!-- write your html here-->
31+ Enter your name:
32+ < input type ="text " placeholder ="Enter your name " name ="aName " size ="16 " minlength ="2 " maxlength ="16 "required >
33+
34+ <!-- the size attribute control how wide the text box, "how many characters it can control-->
35+ <!-- the minlength attribute control the minimum number of characters required-->
36+ <!-- the maxlength attribute control the maximum number of characters required-->
37+ <!-- the placeholder attribute provide a hint for the user on what to enter-->
38+ <!-- the required attribute ensures the user fills out the field-->
39+ < p > Choose your T-shirt color:</ p >
40+ <!-- choosing the radio buttons for color selection-->
41+ < p > please select a color:</ p >
42+ < p >
43+ < input type ="radio " name ="color " id ="red " value ="Red " placeholder ="Red " required >
44+ < label for ="red "label > Red</ label > < br >
45+ < input type ="radio " name ="color " id ="brown " value ="Brown " placeholder ="Brown " required >
46+ < label for ="brown "> Brown</ label > < br >
47+ < input type ="radio " name ="color " id ="black " value ="Black " placeholder ="Black " required >
48+ < label for ="black "> Black</ label > < br >
49+ </ p >
50+
51+ <!-- a list of suggestions using the list attribute and the datalist element -->
52+ Select your T-shirt size:
53+ < input list ="SizeList " name ="T-shirt Size " placeholder =" Choose your size " required > < br >
54+ < datalist id ="SizeList ">
55+ < option value ="XS ">
56+ < option value ="S ">
57+ < option value ="M ">
58+ < option value ="L ">
59+ < option value ="XL ">
60+ < option value ="XXL ">
61+
62+ </ datalist >
63+
64+ </ form >
65+
66+ < p >
67+ < style >
68+ input : invalid {background : rgb (253 , 251 , 253 );}
69+ input : valid {background : rgb (253 , 251 , 253 );}
70+ </ style >
71+ Enter your email:
72+ < input type ="email " placeholder ="Enter your email " required >
73+ </ p >
74+ <!--The input type="email" is used so the browser can validatae the email address format-->
75+ <!--the style tag is used to style the input box. CSS pseudo-classes :valid or :invalid to check if the email is valid and notify the user-->
76+
77+ < form > < input type ="submit "> < input type ="resit "> </ form >
78+ </ main >
79+ < footer >
80+ <!-- change to your name-->
81+ < p > Rawan@</ p >
82+ </ footer >
83+ </ body >
84+ </ html >
0 commit comments