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
110 changes: 101 additions & 9 deletions Form-Controls/index.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,119 @@
<!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="Form for ordering T-Shirts" />
<meta name="viewport" content="width=device-width, initial-scale=1" />

<style>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

How could you separate the code for the styling from the HTML to make it easier to review (because of smaller files with separate responsibilities)

form div {
margin-bottom: 10px;
}
#name,
#email,
#colour {
padding: 10px;
font-size: 1rem;
border: 1px solid black;
border-radius: 5px;
}

input[type="text"],
input[type="email"],
select {
width: 100%;
max-width: 400px;
padding: 20px;
box-sizing: border-box;
}

button {
background-color: blue;
color: white;
padding: 10px 20px;
border: none;
border-radius: 8px;
font-size: 1.5rem;
cursor: pointer;
}
</style>
</head>
<body>
<header>
<h1>Product Pick</h1>
<h1>Product Pick - T-Shirt Order Form</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-->

<div>
<label for="name">Full Name</label>
<input
id="name"
name="name"
type="text"
required
pattern=".*\S.*\S.*"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Well done on the validation

/>
</div>

<div>
<label for="email">Email Address</label>
<input id="email" name="email" type="email" required />
</div>

<fieldset>
<legend>Choose your Colour</legend>

<label for="colour" class="visually-hidden">Colour Choice</label>
<select id="colour" name="colour" required>
<option value="">Select Your Colour</option>
<option value="Burgundy">Burgundy</option>
<option value="Purple">Purple</option>
<option value="Yellow">Yellow</option>
</select>
Comment on lines +70 to +75
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

FYI: I would switch around the form types. Radio buttons are good if there are not to many options to choose from. Space on a web page is precious and for inputs with a lot of options a dropdown can save a lot of space. (You don't need to change anything. This is just an information on the different input types)

</fieldset>

<fieldset>
<legend>Size Choice</legend>
<div>
<label>
<input type="radio" name="size" value="XS" required />
XS
</label>

<label>
<input type="radio" name="size" value="S" />
S
</label>

<label>
<input type="radio" name="size" value="M" />
M
</label>
<label>
<input type="radio" name="size" value="L" />
L
</label>
<label>
<input type="radio" name="size" value="XL" />
XL
</label>
<label>
<input type="radio" name="size" value="XXL" />
XXL
</label>
</div>
</fieldset>


<button type="submit">Place Your Order</button>
</form>
</main>
<footer>
<!-- change to your name-->
<p>By HOMEWORK SOLUTION</p>

<p>By CHINWE CHUKWUMA</p>
</footer>
</body>
</html>
Loading