London | 26-ITP- Sept | Chandramani Gaire | Sprint 1 | Forms Controls - #1507
gaireprakash20-ops wants to merge 13 commits into
Conversation
✅ Deploy Preview for cyf-onboarding-module ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Good structure, with a label on every field and a submit button. Things to sort before it can be marked Complete:
- Name validation rejects valid names. On the deploy preview, type
AlorÄras the name and submit. Both are refused, and the task says two non-space characters is enough. See line 20. - Reload the page and press Submit without touching either dropdown. It goes through with Grey and XS, which the customer never chose. The task says all fields are required. See line 31.
- There's a stray
</div>on line 56. It's the one error the HTML validator from the README checklist (https://validator.w3.org/) reports, and Prettier can't parse the file because of it. - Formatting. Once line 56 is fixed, run
npx prettier --write Form-Controlsfrom the repo root and push.
Add the Needs Review label again once you've pushed.
| <!-- 1. What is the customer's name? I must collect this data and ensure it contains at least two non-space characters.--> | ||
| <div> | ||
| <label for="name">Name</label> | ||
| <input type="text" id="name" placeholder="Chandrmani Gaire" pattern=".*\S.*\S." required> |
There was a problem hiding this comment.
Compare this pattern with the one in the README character by character. The last part is different. What does a . on its own match, and how many characters does it require after the second non-space one?
There was a problem hiding this comment.
type name=.\S.\S.* here
There was a problem hiding this comment.
Fixed. A is rejected and AB goes through now.
| <div> | ||
| <!--What colour should this T-shirt be? I must provide 3 options. How will I ensure they do not choose other colours? --> | ||
| <label for="coloroption">Color option</label> | ||
| <select id="coloroption" name="Color"> |
There was a problem hiding this comment.
This select has no required, and because the first option is a real colour it's already "chosen" when the page loads. What would you add so the customer has to make a choice? Same for the size select on line 42. The MDN form validation page from the prep covers this.
There was a problem hiding this comment.
Both dropdowns fixed. Good.
| <input id="submit" type="submit"> | ||
| </div> | ||
| <br> | ||
| </div> |
There was a problem hiding this comment.
Which <div> is this closing? Count the opening and closing divs above it.
There was a problem hiding this comment.
Fixed, validator is clean.
| <br> | ||
| <div> | ||
| <label for="email">Email</label> | ||
| <input type="email" placeholder="chandramani@gmail.com" id="email" required> |
There was a problem hiding this comment.
The two selects have a name attribute but the name and email inputs don't. What does name do when a form is submitted? Try submitting and look at the address bar.
There was a problem hiding this comment.
change the name="email"
| <footer> | ||
| <!-- change to your name--> | ||
| <p>By HOMEWORK SOLUTION</p> | ||
| <p> By Chandramani Gaire</p> |
There was a problem hiding this comment.
Extra spaces before "By" and between your first and last name, and the starter comment on line 63 can go now.
There was a problem hiding this comment.
Spaces fixed. The starter comment on line 62 is still there, see the main comment.
|
A new user left a comment. This user must be approved by a Netlify team owner before comments can be displayed. |
1 similar comment
|
A new user left a comment. This user must be approved by a Netlify team owner before comments can be displayed. |
abdishakoor-dev
left a comment
There was a problem hiding this comment.
The name check, both dropdowns and the stray div are all fixed, and the validator is clean. One thing left before I mark this Complete: the formatting check, which was point 4 last time.
"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; the indentation wanders between lines 16 and 58.
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, and push. The starter comment on line 62 can go in the same commit. 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
Thanks for sorting the label. Same again once you've pushed: add Needs Review and I'll pick it up.
|
thanks |

Learners, PR Template
Self checklist
Task code
CYF-1004
Changelist
I changed the HTML and made it according to the task requirements, as per the CYF assignment.