Skip to content

London | 25-ITP-May | Maharit Belai | Sprint 1 | Form Controls - #1504

Open
MaharitB wants to merge 9 commits into
CodeYourFuture:mainfrom
MaharitB:feature/form-controls
Open

MaharitB wants to merge 9 commits into
CodeYourFuture:mainfrom
MaharitB:feature/form-controls

Conversation

@MaharitB

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 written all the labels needed to be written on the index.html and tested it using the dev tool .And alsoi have created new file which is .css file to style the web page .

Questions

1.Did i need to create the css file or should I have included it in the index.html ?

@netlify

netlify Bot commented Sep 12, 2026

Copy link
Copy Markdown

Deploy Preview for cyf-onboarding-module ready!

Name Link
🔨 Latest commit cac261e
🔍 Latest deploy log https://app.netlify.com/projects/cyf-onboarding-module/deploys/6aa89eed4d20ca000802d2fd
😎 Deploy Preview https://deploy-preview-1504--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: 86 (no change 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.

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

Nearly there. The dropdowns and the submit button do what they should. It's the name check that has gone wrong, then two small things:

  1. Name validation is the wrong way round. On the deploy preview, type a single space as the name and submit, it goes through. Type AB and it's rejected. See line 21.
  2. The footer still says HOMEWORK SOLUTION, line 63.
  3. Formatting. Prettier fails on both files. Run npx prettier --write Form-Controls from the repo root and push.

Your question: a separate CSS file linked from the head, which is what you've done, is the right way. The task only says HTML and CSS, and keeping the styling in its own file is the normal practice.

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

Comment thread Form-Controls/index.html Outdated
<label for="name">Name:</label>
<!-- must enter name at least with two non space characters-->
<input type="text" id="name" name="name"
pattern=".*\s.*\s*" required title ="Please enter full name"/>

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.

Compare this with the regex in the README one character at a time. The README uses a capital S. What's the difference between \s and \S? That's why a space passes and AB doesn't.

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.

oh I have not noticed. thank you . I will make amends

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.

Closer. See the new comment on line 19.

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 it. A is rejected now and AB goes through.

Comment thread Form-Controls/formexercise.css Outdated
font-size:20px;

}
/*

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.

Commented-out code. The style guide asks for this to be removed rather than kept. Git has it if you want it back.

Comment thread Form-Controls/index.html Outdated
<div>
<button type="submit"> Submit</button>
</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 and the other starter comments (lines 17 and 62) were instructions for you. Now they're done, they can go.

@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
@MaharitB MaharitB 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.

Footer done and the comments cleared, thanks. Two things left before I can mark this Complete:

  1. The name check is closer but still lets a single letter through. Type A on the deploy preview and submit. See line 19.
  2. 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 both of your files fail that check.

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 each of your two files, 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

Comment thread Form-Controls/index.html Outdated
<form>
<label for="name">Name:</label>
<input type="text" id="name" name="name"
pattern=".*\S.*\S*" required title ="Please enter full name"/>

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.

Nearly. Put yours and the README's side by side and look at the last three characters of each. What does * mean after \S, and how many non-space characters does that make the minimum?

@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
@MaharitB

Copy link
Copy Markdown
Author

I have made the necessary changes according to your comments.

@MaharitB MaharitB 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 15, 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 name check now does what the task asks, and both files are formatted. Nothing left to do, so I'm marking this Complete. Well done Maharit.

@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. labels Sep 15, 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