London | 26-ITP-Jan | Kris Oldrini | Sprint 2 | Form Controls#1140
London | 26-ITP-Jan | Kris Oldrini | Sprint 2 | Form Controls#1140XiaoQuark wants to merge 15 commits intoCodeYourFuture:mainfrom
Conversation
… text and email inputs
✅ Deploy Preview for cyf-onboarding-module ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
| <fieldset> | ||
| <legend>Colours</legend> | ||
| <!-- colours input, limit to 3 colours only --> | ||
| <p>Please select a colour *</p> |
There was a problem hiding this comment.
We can make this, <legend>Please select a colour *</legend>
Screen readers announce legends, not surrounding text.
There was a problem hiding this comment.
I will do that, thank you. I just have a question: does it mean that radio buttons should always be inside a fieldset? Because I don't think I can create a "group" label, only one for each input. Unless there's another trick I could not find.
| value="yellow" | ||
| /> | ||
| <label for="yellow">🟨 Yellow </label> | ||
| </p> |
There was a problem hiding this comment.
The <p> is not needed.
pattern like below is not needed,
<li>
<p>
<input>
<label>
</p>
</li>
we can have cleaner,
<li>
<input>
<label>
</li>
this goes to some places on top as well
There was a problem hiding this comment.
Absolutely agree. I wouldn't normally add a
inside a list item, but Lighthouse was not happy with the list's tiny spacing, and, because I could not use CSS, I tried to improvise.
So now I'm not sure if I can remove them or leave forever.
| id="email" | ||
| name="customerEmail" | ||
| placeholder="jsmith@email.com" | ||
| pattern="^[\w.-]+@[\a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$" |
There was a problem hiding this comment.
\a is invalid inside character class
Browsers already validate emails using: type="email"
you can remove the pattern completely
<input type="email" ... required />
There was a problem hiding this comment.
Ops, that was a missed typo. I've corrected it now, thank you
There was a problem hiding this comment.
When you say remove the pattern do you mean for this specific sprint or in general?
There was a problem hiding this comment.
Above are suggestions. Other than that this submission meets the expected learning outcomes for the exercise.
It demonstrates understanding of form structure and validation fundamentals, and shows readiness to continue progressing through the module. Nice work @XiaoQuark

Learners, PR Template
Self checklist
Changelist
This PR adds a semantic HTML form for ordering a t-shirt, following the given requirements.
Form Structure
Customer Information
T-shirt Options