-
-
Notifications
You must be signed in to change notification settings - Fork 418
London | 26-ITP-Jan | Kris Oldrini | Sprint 2 | Form Controls #1140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can make this, <legend>Please select a colour *</legend>
Screen readers announce legends, not surrounding text.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ops, that was a missed typo. I've corrected it now, thank you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you say remove the pattern do you mean for this specific sprint or in general?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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