Manchester | 26-ITP-Jan | Liban Jama | Sprint 2 | Form-Controls#1082
Manchester | 26-ITP-Jan | Liban Jama | Sprint 2 | Form-Controls#1082libanj0161 wants to merge 12 commits intoCodeYourFuture:mainfrom
Conversation
✅ Deploy Preview for cyf-onboarding-module ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Form-Controls/index.html
Outdated
| <input id="Extra Extra Large"type="radio" name="size" value="XXL" /> | ||
| <label for="Extra Extra Large">Extra Extra Large</label> <br> | ||
|
|
||
|
|
There was a problem hiding this comment.
How do we submit the form? is there an element to use to submit the form ?
Form-Controls/index.html
Outdated
| <br> | ||
|
|
||
| <p>Size</p> | ||
|
|
There was a problem hiding this comment.
well done for the good work.
just a few more things to do
can we use a dropdown menu () for the sizes ?
when should you use radio buttons and drop down menu ()
see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/select
Form-Controls/index.html
Outdated
| </p> | ||
| <p> | ||
| <label for="mail">Email</label> | ||
| <input type="email" id="mail" name="user_email" /> |
There was a problem hiding this comment.
can we use a placeholder to guide the users?
can we check for a minlength too ?
is there a way to validate the inputs?
can we use an attribute for the validation?
Form-Controls/index.html
Outdated
| </p> | ||
| <p>Colour</p> | ||
|
|
||
| <label> |
There was a problem hiding this comment.
is there an attribute to associate the label with the radio button ?
Form-Controls/index.html
Outdated
| <form> | ||
| <p> | ||
| <label for="name">Name</label> | ||
| <input type="text" id="name" name="user_name" /> |
There was a problem hiding this comment.
can we use a minlength and other attribute to validate or make sure the input is required ?
can we use the placeholder to guide the users ?
Form-Controls/index.html
Outdated
| <form> | ||
| <p> | ||
| <label for="name">Name</label> | ||
| <input type="text" id="name" name="user_name" placeholder="John Smith" required maxlength="18"/> |
There was a problem hiding this comment.
what happens if someone enters only 1 character ? example "w" what is the minimum expected length for name input ? can we use minlength for validation here ?
Form-Controls/index.html
Outdated
| <input type="email" id="email" name="user_email" placeholder="johnsmith@hotmail.com" required maxlength="32"/> | ||
| </p> |
There was a problem hiding this comment.
what happens when a user enters a@b as email? can we use minlength for validation ?
Form-Controls/index.html
Outdated
|
|
||
| <p>Size</p> | ||
|
|
||
| <label for="size">Size</label> |
There was a problem hiding this comment.
can we validate the form element to make sure users select a value?
Form-Controls/index.html
Outdated
| <p>Colour</p> | ||
|
|
||
| <label for="red"> | ||
| <input id="red" type="radio" name="colour" value="red" /> |
There was a problem hiding this comment.
when should you use a radio button vs select ? which is more appropriate in this scenario and why ? can you also validate this ?
|
@libanj0161 I think you have addressed most but not all of the reviewer's comments. Can you take look at this General Feedback to see if there is anything you can do to make your PR more robust and ready? |
|
Afternoon, I have made the necessary changes. I have added submit elemet, added a dropdown menu for sizes, added placeholders, minimum and maximum lengths, required. Thank you. |
CameronDowner
left a comment
There was a problem hiding this comment.
There is a question in this comment you should try and answer: #1082 (comment)
Form-Controls/index.html
Outdated
| <select id="size" name="size" required> | ||
| <option value="xs">XS</option> | ||
| <option value="s">S</option> | ||
| <option value="m">M</option> | ||
| <option value="l">L</option> | ||
| <option value="xl">XL</option> | ||
| <option value="xxl">XXL</option> | ||
| </select> |
There was a problem hiding this comment.
There is a small error that comes up when I validate this HTML. Can you check what's showing & try and fix it?
Form-Controls/index.html
Outdated
| <label for="name">Name</label> | ||
| <input type="text" id="name" name="user_name" | ||
| placeholder="John Smith" | ||
| required minlength="2" maxlength="18"> |
There was a problem hiding this comment.
Do we want maxlength on name / email address? Could a name be longer than 18 characters, or an email longer than 32 characters?
…end>. Wrapped the size dropdown in <fieldset >and added placeholder option.
|
|
|
ive made all the changes you have put forward. Thank you. |
cjyuan
left a comment
There was a problem hiding this comment.
Form is greatly improved. Just a few minor changes needed.
| <footer> | ||
| <h2>By LIBAN JAMA</h2> | ||
| </footer> |
There was a problem hiding this comment.
Headings (<h1>–<h6>) are meant to label sections of content.
Use of <h2> would make "By LIBAN JAMA" sounds like a header of a major section to a screen reader and to search engines. <p> is probably more appropriate here.
Form-Controls/index.html
Outdated
| <fieldset> | ||
| <legend>Select Size</legend> | ||
|
|
||
| <p> |
There was a problem hiding this comment.
<p> would signal this is a paragraph or some text content. <div>, a generic block-level element, is more appropriate if you only need to create enough spacing to pass the Lighthouse Accessibility check.
|
ive done those changes, please check, thank you. |
|
You only changed one And after you have made all the necessary changes, you may want to check if there are any syntax error that may be introduced by accident. |
|
I've changed the relevant p tags to div tags and have checked for syntax errors for which there are none. |
|
Changes look good! Good job. |


Self checklist
Changelist
I created a form to collect customer data. The form consists of their name, email, t-shirt colour and size. I used only HTML. All the inputs have labels they are associated with. I scored 100 in the Lighthouse Accessibility score. Their name and email has to be a valid one and they can only pick one colour and size out of the options given.
Questions
N/A.