Skip to content
Open
Show file tree
Hide file tree
Changes from 11 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
16 changes: 8 additions & 8 deletions Form-Controls/README.md
Comment thread
djebsoft marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@ Do not write a form action for this project.

Let's write out our testable criteria. Check each one off as you complete it.

- [ ] I have used HTML only.
- [x] I have used HTML only.
- [x] I have not used any CSS or JavaScript.

### 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
43 changes: 37 additions & 6 deletions Form-Controls/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,52 @@
<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-->
<div>
<label for="name">Name</label>
<input type="text" name="name" id="name" required minlength="2" pattern="[A-Za-z\s]+">
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.

🤔 Your pattern might be a bit too restrictive. If I enter a name like 'Jean-Luc', I get a message telling me that my name doesn't follow the pattern.
Also, if you're going to use a pattern, it's a good idea to tell the user in the message, what the pattern in.

</div>
<br>
<div>
<label for="email">E-mail</label>
<input type="email" name="email" id="email" required pattern="[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}">
</div>
<br>
<div>
<label for="colour">select colour</label>
<select name="colour" id="colour" required>
<option value="" disabled selected>Select a colour</option>
<option value="brown">brown</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.

For your colour options, try to follow the same naming convention for all options. Currently, 'brown' and 'yellow' start with a lowercase letter but 'Green' starts with uppercase letter.

<option value="yellow">yellow</option>
<option value="Green">Green</option>
</select>
</div>
<br>
<div>
<label for="size"> select size</label>
<select name="size" id="size" required>
<option value="" disabled selected>Select a size</option>
<option value="xs">XS(extra small)</option>
<option value="s">S(small)</option>
<option value="m">M(medium)</option>
<option value="l">L(large)</option>
<option value="xl">XL(extra large)</option>
<option value="xxl">XXL(double extra large)</option>
</select>
</div>
<br>
<button type="submit">Sumbit</button>
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.

Please check for a typo on the button.

</form>
</main>

<footer>
<!-- change to your name-->
<p>By HOMEWORK SOLUTION</p>
<p>By Boualem Larbi Djebbour</p>
</footer>
</body>
</html>