Skip to content

Commit a72d6c6

Browse files
added label for the select
1 parent df00e2f commit a72d6c6

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

Form-Controls/README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ Writing that out as a series of questions to ask yourself:
2828
All fields are required.
2929
Do not write a form action for this project.
3030

31-
## Acceptnce Criteria
31+
> [!TIP]
32+
> To check whether the customer's name contains at least two non-space characters you may need to use a **regular expression** (or **regex** for short), which is a tool used to match patterns in text. If you wish to learn more about regular expressions there are plenty of resources on the web including the [official MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions), but for this task you can use this regex that we have pre-written for you: `.*\S.*\S.*`.
33+
>
34+
> Now you have the regular expression, it's up to you to figure out how to use it in the context of an HTML form!
35+
36+
## Acceptance Criteria
3237

3338
### Developers must test their work.
3439

@@ -51,8 +56,7 @@ Let's write out our testable criteria. Check each one off as you complete it.
5156

5257
> Before you say you're done: Is your code readable? Does it run correctly? Does it look professional?
5358
54-
These practices reflect the level of quality expected in professiona- [MDN: Form validation](https://developer.mozilla.org/en-US/docs/Learn/Forms/Form_validation)
55-
l work.
59+
These practices reflect the level of quality expected in professional work.
5660
They ensure your code is reliable, maintainable, and presents a polished, credible experience to users.
5761

5862
- [ ] My HTML code has no errors or warnings when validated using https://validator.w3.org/
@@ -62,6 +66,7 @@ They ensure your code is reliable, maintainable, and presents a polished, credib
6266

6367
## Resources
6468
- [MDN: Form controls](https://developer.mozilla.org/en-US/docs/Learn/Forms)
65-
- [Lighthouse](https://developers.google.comcom/web/tools/lighthouse)
69+
- [MDN: Form validation](https://developer.mozilla.org/en-US/docs/Learn/Forms/Form_validation)
70+
- [Lighthouse](https://developers.google.com/web/tools/lighthouse)
6671
- [Lighthouse Guide](https://programming.codeyourfuture.io/guides/testing/lighthouse)
67-
- [Format Code and Make Logical Commits in VS Code](../practical_guide.md)
72+
- [Format Code and Make Logical Commits in VS Code](../practical_guide.md)

Form-Controls/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ <h1>Product Pick</h1>
1818
<div>
1919
<label for="customername">Customer name *: </label>
2020
<input type="text" id="customername" name="customername" required
21-
pattern="^[A-Za-z]{2,}$"
21+
pattern="^[\p{Latin}\p{Ll}]$" minlength="2" maxlength="50"
2222
placeholder="Customer name"/>
2323
</div>
2424

@@ -47,7 +47,7 @@ <h1>Product Pick</h1>
4747
</div>
4848
</div>
4949
<div>
50-
<label>T-shirt size *:</label>
50+
<label for="sizes">T-shirt size *:</label>
5151
<select name="sizes" id="sizes" required>
5252
<option value="" disabled selected>Select size</option>
5353
<option value="xs">XS</option>

0 commit comments

Comments
 (0)