Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 71 additions & 7 deletions Form-Controls/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
Expand All @@ -11,17 +11,81 @@
<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-->
<!-- Requirements:
- Collect customer's name (minimum 2 characters)
- Collect a valid email address
- Allow selection of 1 colour from 3 options
- Allow selection of 1 size from 6 options
- All fields are required
- HTML only (no CSS, no JavaScript)
- No form action
-->

<!-- Name -->
<div>
<label for="name">Name</label>
<input
type="text"
id="name"
name="name"
minlength="2"
placeholder="Roman"
required
/>
</div>
<br />

<!-- Email -->
<div>
<label for="email">Email</label>
<input
type="email"
id="email"
name="email"
placeholder="example@gmial.com"
required
minlength="8"
/>
</div>
<br />

<!-- Colour -->
<div>
<label for="colour">T-Shirt Colour</label>
<select id="colour" name="colour" required>
<option value="" disabled selected>Select a colour</option>
<option value="red">Red</option>
<option value="blue">Blue</option>
<option value="green">Green</option>
</select>
</div>
<br />

<!-- Size -->
<fieldset>
<legend>T-Shirt Size</legend>

Choose a reason for hiding this comment

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

if we don't want to type so many html elements i.e follow the KISS principle can we use the dropdown menu instead ?

<label for="size">Choose a size</label>
<select id="size" name="size" required>
<option value="" disabled selected>Select a 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>
<br />

<button type="submit">Submit</button>
</form>
</main>

<footer>
<!-- change to your name-->
<h2>By HOMEWORK SOLUTION</h2>
<h2>By Ahmad Roman Sanaye</h2>
</footer>
</body>
</html>