-
-
Notifications
You must be signed in to change notification settings - Fork 376
Sheffield | 26-ITP-January | Martha Ogunbiyi | Sprint 2 | Form Controls #978
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
…t email validation
…s the required alt meaninigful
…tual color selection
…ed to avoid accidental checking
✅ Deploy Preview for cyf-onboarding-module ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
cjyuan
left a comment
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.
-
Lighthouse score is 93/100.
- Reason: Touch targets do not have sufficient size or spacing.
-
Consider aligning the wording used in the legend so similar items are described consistently. This helps users understand the information more quickly.
Customer Details
T-Shirt Color Preference
Choose Your T-Shirt Size
- In the PR description, to create list items in Markdown, we need to leave a space between
-and the text.
| <input type="text" id="name" name="name" minlength="3" maxlength="15" autocomplete="name" | ||
| placeholder="enter your name" 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.
Currently a user can enter a name consisting of only space characters (e.g., " "). Can you enforce a stricter validation rule using the pattern attribute to disallow any name that contains only space characters?
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.
Thank for pointing this out. I hadn't considered that scenario.
| <input type="email" id="email" name="email" autocomplete="email" placeholder="enter your email" | ||
| pattern="^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$" 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.
Why use pattern in <input type="email">?
Browsers can already perform built-in email validation.
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 regex pattern was used intentionally to enforce stricter email validation. This compliments native browser validation. It's like a defence in depth approach.

Learners, PR Template
Self checklist
Changelist
Summary
This project demonstrates basic HTML form validation
Changes
-added fields to enter customer details
-added fields to select T-shirt colour
-added fields to pick a size
-ensured input validation
References
Sprint 2 Backlog – Task: Form Controls