Skip to content
136 changes: 129 additions & 7 deletions Form-Controls/index.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,149 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>My form exercise</title>
<meta name="description" content="" />
<meta
name="description"
content="A form to collect customer information and t-shirt preferences."
/>
<meta name="viewport" content="width=device-width, initial-scale=1" />

<!-- Requirements:
  - Collect a valid customer name (min 2 characters)
  - Collect a valid customer email (must be a valid email address)
  - Collect a t-shirt colour (must be 1 of 3 colours)
  - Collect a t-shirt size (must be one of: XS, S, M, L, XL, XXL)
  - All fields are required
  - HTML only (no CSS / JavaScript)
  - Do not write a form action for this project. -->
</head>
<body>
<header>
<h1>Product Pick</h1>
</header>
<main>
<form>
<!-- write your html here-->
<!--
try writing out the requirements first as comments
this will also help you fill in your PR message later-->
<section>
<h2>Customer Information:</h2>
<p>Please fill in your details below: <br /></p>

<!--
          Customer name collection:
          - min 2 characters for validation
          - field is required
          - placeholder text example provided
          -->
<div>
<label for="CustomerFullName"
><em>(required)</em>Customer's Full Name:</label
>
<input
type="text"
id="CustomerFullName"
name="CustomerFullName"
placeholder="e.g. John Smith"
required
minlength="2"
/>
</div>
<br />

<!-- Customer email collection:
- type = "email" for validation
- field is required
- placeholder text example provided
-->

<div>
<label for="CustomerEmail"
><em>(required)</em>Customer's Email:</label
>
<input
type="email"
id="CustomerEmail"
name="CustomerEmail"
placeholder="e.g. john@example.com"
required
/>
</div>
<br />
</section>

<section>
<h2>T-Shirt Selection:</h2>

<p>Select your preferred T-shirt colour and size:</p>

<!-- T-Shirt Colour Selection:
- type = "radio" for selection mandatory one choice
- field is required  
-->

<div>
<fieldset>
<legend><em>(required)</em>T-Shirt Colour:</legend>
<input
type="radio"
id="ColourRed"
name="T-ShirtColourSelection"
value="Red"
required
/>
<label for="ColourRed">Red</label>

<input
type="radio"
id="ColourBlue"
name="T-ShirtColourSelection"
value="Blue"
required
/>
<label for="ColourBlue">Blue</label>

<input
type="radio"
id="ColourGreen"
name="T-ShirtColourSelection"
value="Green"
required
/>
<label for="ColourGreen">Green</label>
</fieldset>
</div>

<!-- T-Shirt Size Selection:
- dropdown select for size options
- field is required  
-->

<div>
<fieldset>
<legend><em>(required)</em>T-Shirt Size:</legend>
<label for="TShirtSize">Select Size:</label>
<select id="TShirtSize" name="TShirtSize" required>
<option value="">-- Select your size --</option>
<option value="XS">XS</option>
<option value="S">S</option>
<option value="M">M</option>
<option value="L">L</option>
<option value="XL">XL</option>
<option value="XXL">XXL</option>
</select>
</fieldset>
</div>

<div>
<br />
<button type="submit">Submit</button>
</div>
</section>
Copy link

@oyagbileoluwaseun oyagbileoluwaseun Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For a form to be submitted, even though we aren't using JavaScript. Do you think a button is missing at the end used to submit a form. Let me know your thoughts on this, or what you think you can add to improve it.

</form>
</main>
<footer>
<!-- change to your name-->
<h2>By HOMEWORK SOLUTION</h2>
<p>By ALEX OKOREFE</p>
</footer>
</body>
</html>