Skip to content
Open
Show file tree
Hide file tree
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
14 changes: 7 additions & 7 deletions Form-Controls/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ Let's write out our testable criteria. Check each one off as you complete it.

### HTML

- [ ] My form is semantic html.
- [ ] All inputs have associated labels.
- [ ] My Lighthouse Accessibility score is 100.
- [ ] I require a valid name. I have defined a valid name as a text string of two characters or more.
- [ ] I require a valid email.
- [ ] I require one colour from a defined set of 3 colours.
- [ ] I require one size from a defined set of 6 sizes.
- [x] My form is semantic html.
- [x] All inputs have associated labels.
- [x] My Lighthouse Accessibility score is 100.
- [x] I require a valid name. I have defined a valid name as a text string of two characters or more.
- [x] I require a valid email.
- [x] I require one colour from a defined set of 3 colours.
- [x] I require one size from a defined set of 6 sizes.

## Resources

Expand Down
111 changes: 86 additions & 25 deletions Form-Controls/index.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,88 @@
<!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-->
<h2>By HOMEWORK SOLUTION</h2>
</footer>
</body>
</html>

<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>T-Shirt Order</h1>
</header>
<main>
<form>
<!-- Customer Details -->
<fieldset>
<legend>Confirm Your Details</legend>

<!-- Name: letters and spaces only -->
<label for="name">Full Name</label>
<input
type="text"
id="name"
name="name"
required
pattern="[A-Za-z\s]{2,}"

Choose a reason for hiding this comment

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

This pattern will block real names like O'connor or Sklodowska-Curie. The initial assignment did not demand letters only.

title="Please enter a valid name (letters and spaces only)"
>

<!-- Email -->
<label for="email">Email Address</label>
<input
type="email"
id="email"
name="email"
required
>
</fieldset>

<!-- Colour Selection -->
<fieldset>
<legend>T-Shirt Colour</legend>

<label>
<input type="radio" name="colour" value="Black" required>
Black
</label>

<label>
<input type="radio" name="colour" value="White">
White
</label>

<label>
<input type="radio" name="colour" value="Blue">
Blue
</label>
</fieldset>

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

<label for="size">Choose a size</label>
<select id="size" name="size" required>
<option value="">-- Select 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>
</fieldset>

<button type="submit">Place Order</button>
</form>
</main>
<footer>
<!-- change to your name-->
<h2>Joma Alrzini</h2>
</footer>
</body>

</html>