Skip to content

London | 26-ITP-Sept | Fung Nin Lee | Sprint 1 | Forms Control - #1484

Open
leerogerfn wants to merge 22 commits into
CodeYourFuture:mainfrom
leerogerfn:feature/form-controls
Open

leerogerfn wants to merge 22 commits into
CodeYourFuture:mainfrom
leerogerfn:feature/form-controls

Conversation

@leerogerfn

@leerogerfn leerogerfn commented Sep 9, 2026

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

  1. initial set up.
  2. submit form requirements.
  3. added fieldset for the form
  4. added customer name
  5. added email address
  6. added color with 3 options
  7. added size for 6 options
  8. added submit button
  9. final version
  10. removed fieldset and changed code of header
  11. set required for all questions in the form.
  12. removed unnecessary paragraph tags for cleaner form layout.
  13. fixed problem of reminder still come out even name submission fulfilled the requirement. And the pull down menu is required to select an option.
  14. added br to seperate different parts of form.
  15. deleted div open code in line 24.
  16. required attributes to options. Use fieldset for color group radio buttons.
  17. removed empty p in line 53.
  18. removed HOMEWORK SOLUTION in line 62.
  19. moved header to body elements.
  20. added br in line 50.
  21. fixed default placeholder options in line 40.

@netlify

netlify Bot commented Sep 9, 2026

Copy link
Copy Markdown

Deploy Preview for cyf-onboarding-module ready!

Name Link
🔨 Latest commit 3401c11
🔍 Latest deploy log https://app.netlify.com/projects/cyf-onboarding-module/deploys/6aa875efeae8e70009c48c81
😎 Deploy Preview https://deploy-preview-1484--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: 83 (🔴 down 3 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.

@github-actions

This comment has been minimized.

@leerogerfn leerogerfn closed this Sep 9, 2026
@leerogerfn leerogerfn reopened this Sep 9, 2026
@github-actions

This comment has been minimized.

2 similar comments
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@leerogerfn leerogerfn added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 9, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 9, 2026
@leerogerfn leerogerfn added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 9, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 9, 2026
@leerogerfn leerogerfn added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 9, 2026
@hey-hammad hey-hammad added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Sep 11, 2026

@hey-hammad hey-hammad left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good work overall! The form is clear and covers the main requirements. A few small improvements to structure, validation, and accessibility would make it stronger.

Comment thread Form-Controls/index.html Outdated
<h1>Product Pick</h1>
<fieldset>
<legend>Product Pick</legend>
</header>

@hey-hammad hey-hammad Sep 11, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can you please review the header tag, there is no opening <header> tag.

Comment thread Form-Controls/index.html Outdated
<input type="text" id="name" name="name" pattern=".*\S.*\S.*">
<div>
<label for="email">Email</label>
<input type="email" id="email" name="email">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The task says all fields are required. How will the form prevent submission if the user leaves the name, email, colour, or size blank?

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

<button type="submit">submit</button>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The submit button currently doesn't do anything, will moving to another place fix this?

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.

Hi Hammad, thank you for reviews and comments. It seems the requirement did not include submitting information to sowhere. Could you elaborate more what I have to do on this point?

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 button is in the right place now, inside the form. The task says not to write a form action, so it doesn't need to send the data anywhere. Its job is to make the browser run the validation when it's clicked. Nothing more to do on this one.

Comment thread Form-Controls/index.html Outdated
<label for="email">Email</label>
<input type="email" id="email" name="email">
</div>
<p></p>

@hey-hammad hey-hammad Sep 11, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

is there a reason for adding empty <p> tag here?

Comment thread Form-Controls/index.html Outdated
<body>
<header>
<h1>Product Pick</h1>
<fieldset>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please review the fieldset tags, think about the correct placement when building a form, more on this in the link below. Thanks

https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/fieldset

@hey-hammad hey-hammad added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Sep 11, 2026
@leerogerfn leerogerfn added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Sep 12, 2026
@leerogerfn leerogerfn added the 📅 Sprint 1 Assigned during Sprint 1 of this module label Sep 12, 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.

Picking this up from Hammad's review. The validation is now right: name, email, colour and size are all required and the name pattern works. Good.

Things to sort before it can be marked Complete:

  1. The <header> has ended up inside <head> (line 7). <head> is for things like <title> and <meta>. Everything the user sees goes in <body>. The starter file on main had the header in the right place, compare against it.
  2. The <div> opened on line 24 is never closed. The HTML validator from the README checklist (https://validator.w3.org/) gives up at that point with 10 errors, and Prettier can't parse the file at all. Fix the structure, then run the validator again until it's clean.
  3. required on line 43 is on an <option>, where it isn't allowed. You already have it on the <select>, which is where it works.
  4. "Color" on line 26 is loose text. Hammad pointed you at fieldset for this and it was removed rather than moved. Which element gives a group of radio buttons a caption?
  5. The footer still has HOMEWORK SOLUTION in it, line 61.
  6. Formatting. Once the structure is fixed, run npx prettier --write Form-Controls from the repo root. The indentation is all over the place at the moment.

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

Comment thread Form-Controls/index.html Outdated
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>My form exercise</title>
<header><h1>Product Pick</h1></header>

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.

This is inside <head>. Which part of the page does <head> describe, and where should something the user sees go? The starter file had this right.

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.

Comment thread Form-Controls/index.html
<input type="email" id="email" name="email" required>
</div>

<div>

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.

This <div> is never closed. Count the opening and closing divs from here to line 51. That's why the validator stops and Prettier can't format the file.

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, and the validator is clean now.

Comment thread Form-Controls/index.html Outdated
<div>
<label for="size">Size</label>
<select name="size" id="size" required>
<option disabled hidden selected required value="">Select One</option>

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.

required isn't an attribute an <option> can have. The one on the <select> on line 42 is the one doing the work, so this can go.

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.

Comment thread Form-Controls/index.html Outdated

<div>
<br>
Color

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.

Loose text as a heading for the radios. Hammad's fieldset link was about this. What does the MDN page from the prep on structuring a form use to group radio buttons and caption them?

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. Fieldset and legend, done.

Comment thread Form-Controls/index.html Outdated
<option value="xxl">XXL</option>
</select>
</div>
<p></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.

Hammad asked about the empty <p> and there's still one here. What is it for?

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.

Gone, good.

Comment thread Form-Controls/index.html Outdated


<footer>
<p>By Fung Nin Lee (Roger) HOMEWORK SOLUTION</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.

HOMEWORK SOLUTION should have gone when you put your name in.

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.

Hi Abdi. Thank you for your comments. Could you feel free to check if it is OK now?

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.

Yes, all the structure points are done. One thing left, formatting, see the main comment.

@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
@hey-hammad hey-hammad added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Sep 14, 2026
@leerogerfn leerogerfn added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels 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 six structure points are sorted: header in the right place, the div closed, required off the option, fieldset and legend on the colour radios, the empty <p> gone and your name in the footer. The validator is clean and every field is validated the way the task asks. Good work getting through that list.

One thing left before I mark this Complete: the formatting check. "My code is consistently formatted" is on the README checklist, and the tool that does it for you is called Prettier. It rearranges spacing and indentation to one agreed style, so that your code is easy to read and so that a reviewer only sees the changes you meant to make, not stray spaces and tabs. At the moment index.html fails that check; look at how far the indentation wanders between lines 14 and 35.

Prettier comes with the CYF extension pack you were asked to install during onboarding. If you're not sure you have it, open VS Code, go to Extensions, and search for CodeYourFuture Extension Pack; install it if it isn't there: https://marketplace.visualstudio.com/items?itemName=CodeYourFuture.cyf-extension-pack

Then open index.html, right click in the editor, choose Format Document, and pick Prettier if VS Code asks which formatter to use. Save, commit the changes it makes, push, and add the Needs Review label again. To make this happen automatically every time you save, follow the format on save steps here: https://github.com/CodeYourFuture/Module-JavaScript-Fundamentals/blob/main/practical_guide.md

@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
@leerogerfn leerogerfn added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Sep 14, 2026
@leerogerfn leerogerfn added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Complete Volunteer to add when work is complete and all review comments have been addressed. labels Sep 14, 2026
@leerogerfn

Copy link
Copy Markdown
Author

All six structure points are sorted: header in the right place, the div closed, required off the option, fieldset and legend on the colour radios, the empty <p> gone and your name in the footer. The validator is clean and every field is validated the way the task asks. Good work getting through that list.

One thing left before I mark this Complete: the formatting check. "My code is consistently formatted" is on the README checklist, and the tool that does it for you is called Prettier. It rearranges spacing and indentation to one agreed style, so that your code is easy to read and so that a reviewer only sees the changes you meant to make, not stray spaces and tabs. At the moment index.html fails that check; look at how far the indentation wanders between lines 14 and 35.

Prettier comes with the CYF extension pack you were asked to install during onboarding. If you're not sure you have it, open VS Code, go to Extensions, and search for CodeYourFuture Extension Pack; install it if it isn't there: https://marketplace.visualstudio.com/items?itemName=CodeYourFuture.cyf-extension-pack

Then open index.html, right click in the editor, choose Format Document, and pick Prettier if VS Code asks which formatter to use. Save, commit the changes it makes, push, and add the Needs Review label again. To make this happen automatically every time you save, follow the format on save steps here: https://github.com/CodeYourFuture/Module-JavaScript-Fundamentals/blob/main/practical_guide.md

Hi @abdishakoor-dev , I just completed formatting check. Please confirm if it is good to complete. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 📅 Sprint 1 Assigned during Sprint 1 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants