Skip to content

London | 26-ITP-SEP | Sakiya Mayow | Sprint 1 | Form Controls - #1500

Open
zakiaao-tech wants to merge 12 commits into
CodeYourFuture:mainfrom
zakiaao-tech:main
Open

zakiaao-tech wants to merge 12 commits into
CodeYourFuture:mainfrom
zakiaao-tech:main

Conversation

@zakiaao-tech

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

I have added the required name and email fields with validation.
I added 3 colour options.
I added 6 T-shirt sizes: XS, S, M, L, XL, XXL.

Questions

I did not use Javascript, will it be okay or do I have to redo it?
Also I am unsure if the lighthouse inspection worked or not.

@netlify

netlify Bot commented Sep 11, 2026

Copy link
Copy Markdown

Deploy Preview for cyf-onboarding-module ready!

Name Link
🔨 Latest commit f95b8bd
🔍 Latest deploy log https://app.netlify.com/projects/cyf-onboarding-module/deploys/6aa81feff1dac40008a175a0
😎 Deploy Preview https://deploy-preview-1500--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.

@zakiaao-tech zakiaao-tech added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 11, 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.

You have few things that need attention. Things to sort before it can be marked Complete:

  1. Name validation. The task asks for one name field that must contain at least two non-space characters, using the regex the README gives you. At the moment two spaces get through. See line 20.
  2. Forms shouldn't have multiple submit buttons. Only a single submit button. The idea is that once the form is filled in, the submit button is clicked. You have four at the moment, one for each field. See line 23.
  3. The validator reports 7 errors: a legend outside a fieldset, ids and names with spaces in them, a missing space between attributes on line 28, and the regex sitting on its own as an attribute. Run the file through https://validator.w3.org/ and work through them.
  4. Formatting. Prettier fails on this file and the indentation drifts further right as it goes. Run npx prettier --write Form-Controls from the repo root.
  5. The footer still says HOMEWORK SOLUTION, line 76.

You asked two things in the description.

No JavaScript is needed, the task is HTML and CSS only.

To run Lighthouse yourself in Chrome: open the page that contains your form, right click and choose Inspect, click the Lighthouse tab at the top of DevTools (if you can't see it, click the >> arrows), tick Accessibility, then click Analyze page load. The score and any failing checks appear in the panel. Also, every PR here gets a deploy preview and Lighthouse runs on it automatically. Scroll up to the netlify bot comment on this PR and you'll see your scores there, including Accessibility 100.

One thing for next time: this PR is opened from your main branch. Make a branch for each task (feature/form-controls) and open the PR from that, so main stays clean.

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

Comment thread Form-Controls/index.html Outdated
<div>
<legend>Customer details</legend>
<label for="firstname">First name:</label>
<input type="text" id="firstname" name="firstname" required .*\S.*\S.*> <br>

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 regex from the README is sitting here as an attribute on its own, so the browser ignores it. Which attribute is it meant to be the value of? I typed two spaces into this field on the deploy preview and it passed. Also the task asks for one name field, not first and last.

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.

One name field now, good. The regex is still a bare attribute though, so this one is still open. See the new comment on line 23.

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.

Fixed now, and two spaces are rejected. Good.

Comment thread Form-Controls/index.html Outdated
<input type="text" id="firstname" name="firstname" required .*\S.*\S.*> <br>
<label for="lastname">Last name:</label>
<input type="text" id="lastname" name="lastname" required>
<button type="Submit">Submit</button>

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.

There are four Submit buttons in this form, and one of them is inside the <select>. A form needs one. Where should it go?

Comment thread Form-Controls/index.html Outdated
<form>
<!-- write your html here-->
<div>
<legend>Customer details</legend>

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.

<legend> is only valid inside one particular element, and it isn't <div>. Which element groups a set of fields and takes a legend? The MDN page from the prep on structuring a form shows it.

Comment thread Form-Controls/index.html Outdated

<div>
<label for="T-shirt colour">Select one T-shirt colour:</label>
<select name="T-shirt colour" id="T-shirt colour" 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.

An id can't contain spaces, and a name shouldn't either. Try submitting the form and look at what appears in the address bar for this field.

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.

Ids and names fixed. The for on the labels wasn't updated to match, so they've come apart. See the comment on line 34.

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.

Matching now. Good.

Comment thread Form-Controls/index.html Outdated

<div>
<label for="email"> Email:</label>
<input type="email"name="email" id="email" 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.

Missing space between type="email" and name="email". The formatter will fix this one.

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.

I received all your feedback and I have completed the corrections, and I will definitely create branch next time. Thank you !

@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
@zakiaao-tech zakiaao-tech 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.

Good progress: one name field, one submit button, ids without spaces, the footer, and the file is formatted. Two things still outstanding:

  1. The regex is still sitting on its own on line 23, so the browser ignores it and two spaces still pass as a name. It needs to be the value of an attribute. The README tip says which one.
  2. When you removed the spaces from the ids on lines 35 and 45 the for on the labels above them (lines 34 and 44) kept the old spelling, so the labels no longer point at anything and the two dropdowns have lost their labels. The HTML validator (https://validator.w3.org/) reports both.

Add the Needs Review label again once you've pushed and I'll mark it Complete.

Comment thread Form-Controls/index.html Outdated
id="fullname"
name="Fullname"
required
.*\S.*\S.*

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.

Still on its own here. Look at how required on the line above is written, and how type="text" is written. The regex needs to be written the same way, as the value of the attribute the README tip names.

Comment thread Form-Controls/index.html Outdated
</div>

<div>
<label for="T-shirt colour">Select one T-shirt colour:</label>

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.

for="T-shirt colour" but the select below is now id="T-shirt-colour". They have to match exactly. Same on line 44.

@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
@zakiaao-tech

Copy link
Copy Markdown
Author

Thank you Abdi for pointing it out, I have learned from my mistakes, and I think I got it this time if not please let me know.

@zakiaao-tech zakiaao-tech 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.

You've got it. The regex is in the pattern attribute and does its job, the labels point at their dropdowns again, and the validator is clean. Marking this Complete.

Two small things for next time, not needed here. Prettier flags the file again: the /> endings it wrote earlier have gone. If that wasn't you, VS Code may have a second formatter running that undoes Prettier's work. Check that Prettier is the default formatter and that format on save uses it, as in https://github.com/CodeYourFuture/Module-JavaScript-Fundamentals/blob/main/practical_guide.md, then run it once more. And in the README checklist, [x ] with a space inside the brackets doesn't render as ticked, it needs to be [x].

@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
@zakiaao-tech

Copy link
Copy Markdown
Author

All done!

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