Skip to content

Commit 67ef06d

Browse files
feat: add semantic form structure with HTML5 validations
1 parent ff7b9d0 commit 67ef06d

1 file changed

Lines changed: 54 additions & 7 deletions

File tree

Form-Controls/index.html

Lines changed: 54 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,71 @@
33
<head>
44
<meta charset="utf-8" />
55
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6-
<title>My form exercise</title>
6+
<title>T-Shirt Order Form</title>
77
<meta name="description" content="" />
88
<meta name="viewport" content="width=device-width, initial-scale=1" />
99
</head>
1010
<body>
1111
<header>
12-
<h1>Product Pick</h1>
12+
<h1>Order Your CYF T-Shirt</h1>
1313
</header>
1414
<main>
1515
<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-->
16+
<div class"form-group">
17+
<label for"customer-name">Full Name</label>
18+
<input
19+
type"text"
20+
id="customer-name"
21+
required
22+
pattern=".*\S.*\S.*"
23+
title"Name must contain at least two non-space characters.">
24+
</div>
25+
26+
<div class="form-group">
27+
<label for="customer-email">Email Address</label>
28+
<input
29+
type="email"
30+
id="customer-email"
31+
name="customer-email"
32+
required>
33+
</div>
34+
</fieldset>
35+
36+
<!-- Section 2: T-Shirt Customization -->
37+
<fieldset>
38+
<legend>T-Shirt Options</legend>
39+
40+
<!-- Colour Selection (Dropdown) -->
41+
<div class="form-group">
42+
<label for="tshirt-color">Choose a Colour</label>
43+
<select id="tshirt-color" name="tshirt-color" required>
44+
<option value="" disabled selected>Select a colour...</option>
45+
<option value="black">Classic Black</option>
46+
<option value="blue">CYF Blue</option>
47+
<option value="white">Minimalist White</option>
48+
</select>
49+
</div>
50+
51+
<!-- Size Selection (Radio Buttons) -->
52+
<div class="form-group">
53+
<span class="label-heading">Select Your Size</span>
54+
55+
<div class="radio-options">
56+
<label><input type="radio" name="tshirt-size" value="XS" required> XS</label>
57+
<label><input type="radio" name="tshirt-size" value="S"> S</label>
58+
<label><input type="radio" name="tshirt-size" value="M"> M</label>
59+
<label><input type="radio" name="tshirt-size" value="L"> L</label>
60+
<label><input type="radio" name="tshirt-size" value="XL"> XL</label>
61+
<label><input type="radio" name="tshirt-size" value="XXL"> XXL</label>
62+
</div>
63+
</div>
64+
</fieldset>
65+
66+
<button type="submit">Confirm Order</button>
2067
</form>
2168
</main>
2269
<footer>
23-
<!-- change to your name-->
70+
<!-- Wing Ting Huang-->
2471
<p>By HOMEWORK SOLUTION</p>
2572
</footer>
2673
</body>

0 commit comments

Comments
 (0)