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
64 changes: 56 additions & 8 deletions Form-Controls/index.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<style>
label {
font-size: 24px;
}
</style>
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you improve the indentation on lines 10, 41, 71-72?

You can use the VSCode's "Format Document" feature to auto-indent the code?
To use the feature, right-click inside the code editor and select the option.

<title>My form exercise</title>
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="A form for selecting a product">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<header>
Expand All @@ -14,14 +19,57 @@ <h1>Product Pick</h1>
<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,
customer name, must have at least two characters
Customers email must have format text@text.text
Colour choice, must be one of red, blue or green
Size choice must be Xs, S, M, L, XL, XXL
-->



<div>
<!-- Name: at least 2 characters -->
<label for="name">Name:</label>
<input type="text" minlength="2" id="name" name="name" required pattern=".*\S.*" title="Name must be at least 2 characters long, cannot be empty or just spaces">
</div>
<div>
<!-- Email: basic format text@text.text -->
<label for="email">Email:</label>
<input type="email" id="email" name="email" title="Enter a valid email like user@example.com">
</div>
<div>
<!-- Colour choice: red, blue, green -->
<label for="colour">Colour:</label>
<select id="colour" name="colour" required>
<option value="">Select a colour</option>
<option value="red">Red</option>
<option value="blue">Blue</option>
<option value="green">Green</option>
</select>
</div>
<div>
<!-- Size choice: XS, S, M, L, XL, XXL -->
<label for="size">Size:</label>
<select id="size" name="size" required>
<option value="">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>
</div>


<button type="submit">Submit</button>
</form>
</main>
<footer>
<!-- change to your name-->
<h2>By HOMEWORK SOLUTION</h2>
<h2>
By Damian Dunkley for Code your Future ITP Jan 2026 Sprint 2</h2>
</footer>
</body>
</html>