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
50 changes: 40 additions & 10 deletions Form-Controls/index.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,57 @@
<!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">
<title>My form exercise</title>
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<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-->
<label for="user-name">Your Name:</label>
<input id="user-name" name="user-name" type="text" pattern="[A-Za-z\s\-]{2,}" title="Please enter at least 2 letters. Numbers and symbols are not allowed" required>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pattern validation works for 2 or more names - good work



<br>

<label for="email">Your Email:</label>
<input id="email" name="user_email" type="email" required>

<br>

<label for="colors">Choose your favorite color:</label>
<select id="colors" name="colour" required>
<option value="" disabled selected>Select a color...</option>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nice choice to disable the first option

<option value="red">Red</option>
<option value="blue">Blue</option>
<option value="green">Green</option>
</select>

<br>

<label for="shirtsize">What size do you want?</label>

<select id="shirtsize" name="size" required>
<option value="" disabled selected>Select a size...</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 id="go" type="submit"> Submit
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I reckon the ID attribute could be something relating to the action like 'form-submit'

</button>

</form>
</main>
<footer>
<!-- change to your name-->
<p>By HOMEWORK SOLUTION</p>
<p>Chan Yat Long</p>
</footer>
</body>
</html>
Loading