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
91 changes: 66 additions & 25 deletions Form-Controls/index.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,68 @@
<!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="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-->
<p>By HOMEWORK SOLUTION</p>
</footer>
</body>
<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 aria-label="order form">
<label for="name">name: </label>
<input
type="text"
name="name"
id="name"
minlength="2"
maxlength="100"
autocomplete="name"
pattern="[a-zA-ZÀ-ÖØ-öø-ÿ'\-\s]{2,100}"
aria-label="enter your name"
required />

<label for="email">email: </label>
<input
type="email"
name="email"
id="email"
aria-label="enter your email address"
required />

<label for="shirt-color">shirt color: </label>
<select
name="shirt-color"
id="shirt-color"
aria-label="select shirt color"
required>
<option value="red">red</option>
<option value="red">green</option>
<option value="red">blue</option>
</select>
Comment on lines +37 to +45
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 configure the <select> element so that no option is selected by default, and thus allowing the user to make an explicit choice?

Also, the options are not marked up correctly. (Copy-paste error)

<select
name="shirt-size"
id="shirt-size"
aria-label="select shirt size"
required>
<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>
<button type="submit" aria-label="submit order">
Check out
</button>
</form>
</main>
<footer>
<!-- change to your name-->
<p>By HOMEWORK SOLUTION</p>
</footer>
</body>
</html>