-
-
Notifications
You must be signed in to change notification settings - Fork 388
London | 26-ITP-Jan | Oussama Mouggal | Sprint 2| Form-controls #1009
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 all commits
6483130
f862f4e
7c17a2b
f09e144
b341ce9
bde8e77
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 | ||
|---|---|---|---|---|
|
|
@@ -12,16 +12,64 @@ | |||
| <h1>Product Pick</h1> | ||||
| </header> | ||||
| <main> | ||||
| <form> | ||||
| <!-- write your html here--> | ||||
| <form> | ||||
| <label for="name">Name:</label> | ||||
| <input type="text" id="name" name="name" required | ||||
| minlength="2" pattern="^[A-Za-z ]{2,}$" | ||||
| title="Name must be at least 2 letters and contain only letters" | ||||
| /> | ||||
| <br /><br /> | ||||
| <label for="email">Email:</label> | ||||
| <input type="email" id="email" name="email" placeholder="name@example.com" required /> | ||||
| <br /><br /> | ||||
| <fieldset> | ||||
| <legend>Please select a color:</legend> | ||||
| <input type="radio" id="black" name="color" value="black" /> | ||||
| <label for="black">black</label> | ||||
| <br /> | ||||
| <br /> | ||||
| <input type="radio" id="blue" name="color" value="blue" /> | ||||
| <label for="blue">blue</label> | ||||
| <br /> | ||||
| <br /> | ||||
| <input type="radio" id="red" name="color" value="red" /> | ||||
| <label for="red">red</label> | ||||
| <br /> | ||||
| <br /> | ||||
| </fieldset> | ||||
| <br /> <br /> | ||||
| <label for="size">Please select a size:</label> | ||||
| <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> | ||||
|
Comment on lines
+42
to
+49
|
||||
| <br /><br /> | ||||
| <button type="submit">Submit</button> | ||||
| </form> | ||||
|
|
||||
|
|
||||
|
|
||||
| <!-- | ||||
| try writing out the requirements first as comments | ||||
| this will also help you fill in your PR message later--> | ||||
| We are selling t-shirts. Write a form to collect the following data: | ||||
| Our customers already have accounts, so we know their addresses and charging details already. We don't need to collect that data. We want to confirm they are the right person, then get them to choose a colour and size. | ||||
| Writing that out as a series of questions to ask yourself: | ||||
| What is the customer's name? I must collect this data, and validate it. But what is a valid name? I must decide something. | ||||
| What is the customer's email? I must make sure the email is valid. Email addresses have a consistent pattern. | ||||
| What colour should this t-shirt be? I must give 3 options. How will I make sure they don't pick other colours? | ||||
| What size does the customer want? I must give the following 6 options: XS, S, M, L, XL, XXL | ||||
| All fields are required. Do not write a form action for this project.--> | ||||
| </form> | ||||
|
||||
| </form> |
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.
The radio buttons for color selection should have the required attribute to enforce that users make a selection. Since all fields are required per the specification, at least one radio button in the group should be marked as required to ensure a color is selected before form submission.