Repository navigation
London| 26-ITP-Sep|Perrila Tamang|Sprint 1|Form controls #1491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 3 commits
9326bc1
d6ba3b7
8d1021c
fb75252
06185f9
3969597
79d3059
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,22 +6,105 @@ | |
| <title>My form exercise</title> | ||
| <meta name="description" content="" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
| <style> | ||
| button, | ||
| select { | ||
| min-height: 44px; | ||
| padding: 8px 12px; | ||
| } | ||
|
|
||
| button { | ||
| margin-right: 8px; | ||
| } | ||
| </style> | ||
| </head> | ||
|
|
||
| <body> | ||
| <header> | ||
| <h1>Product Pick</h1> | ||
| </header> | ||
|
|
||
| <main> | ||
| <form> | ||
| <!-- write your html here--> | ||
| <!-- | ||
| try writing out the requirements first as comments | ||
| this will also help you fill in your PR message later--> | ||
| <form action="results.html" method="GET"> | ||
|
cjyuan marked this conversation as resolved.
Outdated
|
||
| <div> | ||
| <label for="name">Name</label> | ||
| <input | ||
| type="text" | ||
| name="Name" | ||
| id="name" | ||
|
Comment on lines
+22
to
+25
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated to include the autocomplete attribute. Thanks for the suggestion! |
||
| placeholder="Username" | ||
| pattern=".*\S.*\S.*" | ||
| title="Please enter at least two non-space characters." | ||
| required | ||
| /> | ||
| </div> | ||
|
|
||
| <div> | ||
| <label for="email">Email</label> | ||
| <input | ||
| type="email" | ||
| name="Email" | ||
| id="email" | ||
| placeholder="Email" | ||
| required | ||
| /> | ||
| </div> | ||
|
|
||
| T-shirt Color | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This label does not have an accompanying semantic HTML element. Could you use an AI tool to explore how you could improve the semantic structure of this form?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for pointing this out. I’ve updated the form so the label is properly associated with its corresponding form control and improved the semantic structure where needed. |
||
|
|
||
| <div> | ||
| <label for="red">Red</label> | ||
| <input | ||
| type="radio" | ||
| name="color" | ||
| id="red" | ||
| value="Red" | ||
| required | ||
| /> | ||
| </div> | ||
|
|
||
| <div> | ||
| <label for="blue">Blue</label> | ||
| <input | ||
| type="radio" | ||
| name="color" | ||
| id="blue" | ||
| value="Blue" | ||
| /> | ||
| </div> | ||
|
|
||
| <div> | ||
| <label for="pink">Pink</label> | ||
| <input | ||
| type="radio" | ||
| name="color" | ||
| id="pink" | ||
| value="Pink" | ||
| /> | ||
| </div> | ||
|
|
||
| <div> | ||
| <label for="size">T-shirt Size</label> | ||
| <select name="T-shirt Size" id="size" required> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The values of the
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for pointing out I have used kebab-case and updated the name attributes to be consistent. |
||
| <option label="Select a size" value=""></option> | ||
| <option label="XS" value="XS"></option> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could also consider the this syntax:
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the feedback, corrected with the recommended syntax. |
||
| <option label="S" value="S"></option> | ||
| <option label="M" value="M"></option> | ||
| <option label="L" value="L"></option> | ||
| <option label="XL" value="XL"></option> | ||
| <option label="XXL" value="XXL"></option> | ||
| </select> | ||
| </div> | ||
|
|
||
| <div> | ||
|
Comment on lines
+89
to
+95
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indentation is off. Suggestion:
Resource: Visual Studio Code - Formatting
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for spotting that! I have corrected the indentation. |
||
| <button type="reset">Reset</button> | ||
| <button type="submit">Submit</button> | ||
| </div> | ||
| </form> | ||
| </main> | ||
|
|
||
| <footer> | ||
| <!-- change to your name--> | ||
| <p>By HOMEWORK SOLUTION</p> | ||
| <p>By Perrila Tamang</p> | ||
| </footer> | ||
| </body> | ||
| </html> | ||
| </html> | ||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To follow best practice, could you move the CSS code to an external file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes sure,CSS Code has been moved to a separate file as style.css