Skip to content

London | 26-ITP-SEP | Carol Nassuna | Sprint 1 | Form-Controls - #1517

Open
Mugs3 wants to merge 4 commits into
CodeYourFuture:mainfrom
Mugs3:feature/form-controls
Open

Mugs3 wants to merge 4 commits into
CodeYourFuture:mainfrom
Mugs3:feature/form-controls

Conversation

@Mugs3

@Mugs3 Mugs3 commented Sep 13, 2026

Copy link
Copy Markdown

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
15 Sept:
I have formatted both documents using prettier and changed form method to get as fix for page not found error on clicking place order button
14 Sept:
I have updated and fixed issues raised by the reviewer and linked the style.css file to the index file

13 Sept
I have updated the Form-Control file/index file to design and implement the user requirements into a usable system
I have also added the css file to make the system to improve the look and feel of the system

I agree to follow the code of conduct for this organisation.

@netlify

netlify Bot commented Sep 13, 2026

Copy link
Copy Markdown

Deploy Preview for cyf-onboarding-module ready!

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

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

Good attempt. A few things to sort before it can be marked Complete:

  1. Name validation. The task asks for at least two non-space characters and the README gives you the regex to use. At the moment a single letter or two spaces goes through. See line 18.
  2. The task says not to write a form action. This form has one, and on the deploy preview pressing Place Order sends the customer to a page that doesn't exist. See line 15.
  3. Reload the page and press Place Order with valid name and email. It goes through with Red and XS, which the customer never chose. This is also two of the three errors the HTML validator from the README checklist (https://validator.w3.org/) reports. See line 38.
  4. There's a stray </div> on line 54. It's the validator's third error and Prettier can't parse the file because of it.
  5. Customer Number isn't part of the task. The README says we already have the customer's details and only need name, email, colour and size. See line 22.
  6. style.css isn't linked from the page, so none of it applies. What goes in the <head> to load a stylesheet?
  7. The footer still says HOMEWORK SOLUTION, line 62.
  8. Formatting. Once the structure is fixed, run npx prettier --write Form-Controls from the repo root and push.

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

Comment thread Form-Controls/index.html Outdated
<form action="order" method="post">
<div>
<label for="CustomerName">Customer Name:</label>
<input type="text" id="CustomerName" name="CustomerName" 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.

required only stops the field being empty. Type two spaces and it passes. The README gives you a regex for "at least two non-space characters". Which attribute does it go in?

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 two spaces are rejected now. Good.

Comment thread Form-Controls/index.html Outdated
<!--
try writing out the requirements first as comments
this will also help you fill in your PR message later-->
<form action="order" method="post">

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 task says "Do not write a form action for this project". What happens on the deploy preview when you fill the form in correctly and press Place Order?

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.

Action gone. One thing left on this line, see the new comment.

Comment thread Form-Controls/index.html Outdated
<div>
<label for="T-ShirtsColor">T-Shirt Color:</label>
<select id="T-ShirtsColor" name="T-ShirtsColor" required>
<option value="Red">Red</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.

Red is selected as soon as the page loads, so required has nothing to check. Read the validator's message for this line. What does it say the first option needs? Same for the size select on line 46.

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.

Both dropdowns fixed. Good.

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

Which <div> is this closing? Count the opening and closing divs above it.

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>
<div>
<label for="CustomerNumber">Customer Number:</label>
<input type="number" id="CustomerNumber" name="CustomerNumber" 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.

Where in the task is a customer number asked for? Every extra required field is one more thing the customer has to get right before they can order.

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.

Removed, good.

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

Nearly all of it is done: the name check works, both dropdowns now insist on a choice, the stray </div> is gone, Customer Number is out, the stylesheet loads and your name is in the footer. The validator is clean. Two things left before I can mark this Complete:

  1. method="post" is still on the form tag, so pressing Place Order sends the customer to a "page not found". Make it plain <form> like the starter file. See line 16.
  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 index.html and style.css 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
try writing out the requirements first as comments
this will also help you fill in your PR message later-->
</form>
<form method="post">

@abdishakoor-dev abdishakoor-dev Sep 14, 2026

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.

action has gone, good. method="post" should go too. On a real site a form does have an action and a method, that's how the data gets to a server, and you'd be right to reach for them. This exercise is the exception: the task says not to write a form action because there's no server to send to, and with method="post" left on the browser tries to send anyway, which is why you land on "page not found". Make the tag plain <form> like the starter file. The Place Order button's only job here is to make the browser run the validation.

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 method="post" on GitHub. Make it plain <form>, no method at all.

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

Your commit message says both files were formatted and the form method changed, but what has arrived on GitHub is only part of that: index.html is formatted (good), style.css hasn't changed at all and still fails Prettier, and line 16 still reads <form method="post">.

Two likely causes: the changes to style.css and the form tag weren't saved before you committed, or they were saved but not staged. In VS Code, look at the Source Control panel after you save; any file still listed under Changes hasn't been committed yet.

Two things left, same as before:

  1. Line 16: the form tag should be plain <form>, with no method either (not get), since this form doesn't send anywhere.
  2. Format style.css.

Save, check Source Control shows nothing outstanding, commit, push, and add the Needs Review label again.

@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 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants