Skip to content
Closed
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
113 changes: 107 additions & 6 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 @@ -13,15 +13,116 @@ <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-->
<fieldset>
<legend>Customer Details</legend>

<label for="name">Name:</label>
<input
type="text"
id="name"
required
name="customerName"
minlength="2"
pattern=".*\S.*"
title="Name must include at least one non-space character."
/>
Comment on lines +20 to +28
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.

Currently a user can enter a name consisting of only space characters (e.g., " "). Can you enforce a stricter validation rule using the pattern attribute to disallow any name that contains only space characters?

<br /><br />
<label for="email">Email:</label>
<input type="email" id="email" required name="customerEmail" />
</fieldset>

<br />
<fieldset>
<legend>T-Shirt Colour</legend>

<div>
<input
type="radio"
id="colourBlack"
name="tshirtColour"
value="black"
required
/>
<label for="colourBlack">Black</label>
</div>

<br />

<div>
<input
type="radio"
id="colourWhite"
name="tshirtColour"
value="white"
/>
<label for="colourWhite">White</label>
</div>

<br />

<div>
<input
type="radio"
id="colourBlue"
name="tshirtColour"
value="blue"
/>
<label for="colourBlue">Blue</label>
</div>
</fieldset>

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

<div>
<input type="radio" id="sizeXS" name="size" value="XS" required />
<label for="sizeXS">XS</label>
</div>

<br />

<div>
<input type="radio" id="sizeS" name="size" value="S" required />
<label for="sizeS">S</label>
</div>

<br />

<div>
<input type="radio" id="sizeM" name="size" value="M" required />
<label for="sizeM">M</label>
</div>

<br />

<div>
<input type="radio" id="sizeL" name="size" value="L" required />
<label for="sizeL">L</label>
</div>

<br />

<div>
<input type="radio" id="sizeXL" name="size" value="XL" required />
<label for="sizeXL">XL</label>
</div>

<br />

<div>
<input type="radio" id="sizeXXL" name="size" value="XXL" required />
<label for="sizeXXL">XXL</label>
</div>
</fieldset>

<br />

<button type="submit">Submit</button>
</form>
</main>
<footer>
<!-- change to your name-->
<h2>By HOMEWORK SOLUTION</h2>
<h2>By Daniel Aderibigbe</h2>
</footer>
</body>
</html>