-
-
Notifications
You must be signed in to change notification settings - Fork 349
Manchester| 25-ITP-September| Jennifer Isidienu| Sprint 2 | Form Controls #899
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
54afbf2
915999d
af0d7e1
5016f99
591dfdf
5b027da
066a536
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 |
|---|---|---|
|
|
@@ -3,25 +3,97 @@ | |
| <head> | ||
| <meta charset="utf-8" /> | ||
| <meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
| <title>My form exercise</title> | ||
| <meta name="description" content="" /> | ||
| <title>My Form Exercise</title> | ||
| <meta name="description" content="T-shirt order form" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
| </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="#" method="get"> | ||
| <fieldset> | ||
| <legend>Customer Details</legend> | ||
|
|
||
| <p> | ||
| <label for="name">Name</label> | ||
| <input | ||
| type="text" | ||
| name="name" | ||
| id="name" | ||
| required | ||
| minlength="2" | ||
| pattern=".*\S.*" | ||
| title="Name must contain at least one non-space character" | ||
| /> | ||
| </p> | ||
|
|
||
| <p> | ||
| <label for="email">Email</label> | ||
| <input type="email" name="email" id="email" required /> | ||
| </p> | ||
| </fieldset> | ||
|
|
||
| <fieldset> | ||
| <legend>T.shirt Details</legend> | ||
|
|
||
| <p> | ||
| <label for="color">Color</label> | ||
| <select name="color" id="color" required> | ||
| <option value="" disabled selected>-- Select a colour --</option> | ||
| <option value="blue">Blue</option> | ||
| <option value="black">Black</option> | ||
| <option value="pink">Pink</option> | ||
| </select> | ||
| </p> | ||
| </fieldset> | ||
|
|
||
| <fieldset> | ||
| <legend>Size <span aria-hidden="true">*</span></legend> | ||
|
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. What does
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. It makes the asterisk to only be seen and not read out... |
||
|
|
||
| <p> | ||
| <input type="radio" required name="size" id="r1" value="XS" /> | ||
| <label for="r1">XS</label> | ||
| </p> | ||
|
|
||
| <p> | ||
| <input type="radio" required name="size" id="r2" value="S" /> | ||
| <label for="r2">S</label> | ||
| </p> | ||
|
|
||
| <p> | ||
| <input type="radio" required name="size" id="r3" value="M" /> | ||
| <label for="r3">M</label> | ||
| </p> | ||
|
|
||
| <p> | ||
| <input type="radio" required name="size" id="r4" value="L" /> | ||
| <label for="r4">L</label> | ||
| </p> | ||
|
|
||
| <p> | ||
| <input type="radio" required name="size" id="r5" value="XL" /> | ||
| <label for="r5">XL</label> | ||
| </p> | ||
|
|
||
| <p> | ||
| <input type="radio" required name="size" id="r6" value="XXL" /> | ||
| <label for="r6">XXL</label> | ||
| </p> | ||
| </fieldset> | ||
|
|
||
| <p> | ||
| <button type="reset">Reset</button> | ||
| <button type="submit">Submit</button> | ||
| </p> | ||
| </form> | ||
| </main> | ||
|
|
||
| <footer> | ||
| <!-- change to your name--> | ||
| <h2>By HOMEWORK SOLUTION</h2> | ||
| <h2>By Jennifer Isidienu</h2> | ||
| </footer> | ||
| </body> | ||
| </html> | ||
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
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.
What is this
patternattribute doing here?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.
It ensures the reader types in one character
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.
Why do we need this as well as
minlength="2"?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.
minlength="2" only checks length, not content. Even if someone types two spaces, minlength="2" will accept it. The pattern ensures there’s at least one non-space character.