Skip to content

London | 26-ITP-Sep | Alan Mak | Sprint 1 | Form Controls - #1515

Open
AlanGit-debug2604 wants to merge 6 commits into
CodeYourFuture:mainfrom
AlanGit-debug2604:feature/form-controls
Open

AlanGit-debug2604 wants to merge 6 commits into
CodeYourFuture:mainfrom
AlanGit-debug2604:feature/form-controls

Conversation

@AlanGit-debug2604

Copy link
Copy Markdown

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Task code

CYF-1004

Changelist

Create a T-shirt order form. Included required name (regex-validated), email, colour (radio group, 3 options), and size (dropdown, 6 options). Verified negative/positive validation paths. Lighthouse accessibility score 100, W3C validator shows no errors or warnings.

Questions

  1. Whether radios need "required" on all three or just one?
  2. Whether was the right choice for Size vs. 6 radio buttons? In validator, outcome list saying : "Info: Trailing slash on void elements [has no effect]", then quote a piece of code, e.g. ↩ ↩
    Why those outcomes happen and what they are after?

@netlify

netlify Bot commented Sep 13, 2026

Copy link
Copy Markdown

Deploy Preview for cyf-onboarding-module ready!

Name Link
🔨 Latest commit 76eb3db
🔍 Latest deploy log https://app.netlify.com/projects/cyf-onboarding-module/deploys/6aa823a369e3f50008c4468e
😎 Deploy Preview https://deploy-preview-1515--cyf-onboarding-module.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
2 paths audited
Performance: 100 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 84 (🔴 down 2 from production)
PWA: -
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@AlanGit-debug2604 AlanGit-debug2604 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 13, 2026

@abdishakoor-dev abdishakoor-dev left a comment

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.

The validation is all correct and the file is clean, validator and Prettier both pass. Two things to sort before it can be marked Complete:

  1. The colour radios have no caption. On the page a customer just sees Red, Green, Blue with nothing saying what they're choosing, and a screen reader has even less to go on. See line 23.
  2. The footer still says HOMEWORK SOLUTION, line 45.

Your questions:

  1. One is enough. The browser treats radios that share a name as one group, and if any radio in the group has required the whole group needs a selection. The usual practice is to put it on the first radio, so the next person reading the code finds it where they expect. Putting it on all three does no harm, it's just repeated. MDN covers this under "required" here: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input/radio
  2. Both meet the task, so this is a design question rather than a code one. The GOV.UK Design System has short, research-backed guidance on when to use each: https://design-system.service.gov.uk/components/radios/ and https://design-system.service.gov.uk/components/select/
  3. "Info" is neither an error nor a warning, so the checklist is satisfied. The / before > on elements like <input> does nothing in HTML, the browser ignores it. Prettier adds it by default, which is why it's there. Leave it or remove it, both are valid.

Add the Needs Review label again once you've pushed.

Comment thread Form-Controls/index.html Outdated
<label for="Email">Your email address</label>
<input type="email" id="Email" required />
<!-- Colour Any one from three options available-->
<input type="radio" name="colour" id="Red" value="Red" required />

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.

Nothing on the page tells the customer what these three radios are for, and a <label> on its own can't caption a group. Which element does the MDN page from the prep on structuring a form use to group radio buttons and give them a caption?

@AlanGit-debug2604 AlanGit-debug2604 Sep 14, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fieldset and legend elements =)

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.

That's the one. A screen reader now reads the legend before each of the three options.

Comment thread Form-Controls/index.html
this will also help you fill in your PR message later-->
<!-- Name: required, at least 2 non-space characters-->
<label for="Your-name">What is your name</label>
<input type="text" id="Your-name" pattern=".*\S.*\S.*" required />

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.

The radios have a name attribute, this input and the email and size don't. What does name do when a form is submitted? Submit the form and look at the address bar. Not a blocker.

@abdishakoor-dev abdishakoor-dev added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Sep 14, 2026
@AlanGit-debug2604 AlanGit-debug2604 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 14, 2026

@abdishakoor-dev abdishakoor-dev left a comment

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.

Fieldset and legend in, validator and Prettier both pass. One small thing left before I mark this Complete: the placeholder in the footer said "change to your name", and the comment saying so is still there on line 47. It now shows your GitHub username. Put your name in, remove that comment, and add the Needs Review label again.

Comment thread Form-Controls/index.html Outdated
<footer>
<!-- change to your name-->
<p>By HOMEWORK SOLUTION</p>
<p>By AlanGit-debug2604</p>

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.

The starter comment above asks for your name, and your PR title gives it. Small detail, but it's what a customer would see at the bottom of the page.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. Updated as requested.

@abdishakoor-dev abdishakoor-dev removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 14, 2026
@AlanGit-debug2604 AlanGit-debug2604 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 14, 2026

@abdishakoor-dev abdishakoor-dev left a comment

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.

All done, marking this Complete. Well done Alan.

@abdishakoor-dev abdishakoor-dev added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Reviewed Volunteer to add when completing a review with trainee action still to take. labels Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants