Skip to content
104 changes: 79 additions & 25 deletions Form-Controls/index.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,81 @@
<!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="viewport" content="width=device-width, initial-scale=1" />
</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-->
</form>
</main>
<footer>
<!-- change to your name-->
<h2>By HOMEWORK SOLUTION</h2>
</footer>
</body>
</html>

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>My form exercise for selling T-shirts</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>

<body>
<header>
<h1>Product Pick</h1>
</header>
<main>
<form>
<!-- 1. What is the customer's name? I must collect this data, and validate it. But what is a valid name? I must decide something. -->
<label for="customer-name">Customer's name</label>
<input type="text" id="customer-name" name="customer-name" required minlength="2" placeholder="Enter your name"
autocomplete="name" autofocus>
<hr>

<!-- 2. What is the customer's email? I must make sure the email is valid. Email addresses have a consistent pattern. -->
<p id="email-hint">Please use your account email.</p>
<label for="customer-email">Email</label>
<input type="email" id="customer-email" name="customer-email" required autocomplete="email"
aria-describedby="email-hint" placeholder="name@example.com">
<hr>

<!-- 3. What colour should this t-shirt be? I must give 3 options. How will I make sure they don't pick other colours? -->
<fieldset>
<legend>Choose your T-shirt colour, please</legend>
<div>
<label class="color-label">
<input type="radio" name="tshirt-color" value="red" required>
<svg width="20" height="20"></svg>
Red
</label>
</div>
<div>
<label class="color-label">
<input type="radio" name="tshirt-color" value="green">
<svg width="20" height="20"></svg>
Green
</label>
</div>
<div>
<label class="color-label">
<input type="radio" name="tshirt-color" value="blue">
<svg width="20" height="20"></svg>
Blue
</label>
</div>
</fieldset>
<hr>

<!-- 4. What size does the customer want? I must give the following 6 options: XS, S, M, L, XL, XXL -->
<div>
<label for="tshirt-size">Choose your size, please</label>
<select id="tshirt-size" name="tshirt-size" required>
<option value="" selected disabled>Pick a size, please.</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>
</div>
<hr>
<button type="submit">Confirm order</button>
</form>
</main>
<footer>
<p>Mariia Serhiienko</p>
<h2>By HOMEWORK SOLUTION</h2>
</footer>
</body>

</html>
Loading