-
-
Notifications
You must be signed in to change notification settings - Fork 488
London | 26-ITP-May | Gideon Defar | Sprint 1 | Form Control #1289
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
d845fd4
b9cc5f9
6b3b802
956c48d
dbce8f7
a511293
9057623
fd5f1a4
9388fc6
a33f433
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 |
|---|---|---|
| @@ -1,27 +1,75 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="utf-8" /> | ||
| <meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
| <title>My form exercise</title> | ||
| <meta name="description" content="" /> | ||
| <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> | ||
| </main> | ||
| <footer> | ||
| <!-- change to your name--> | ||
| <h2>By HOMEWORK SOLUTION</h2> | ||
| </footer> | ||
| </body> | ||
| </html> | ||
|
|
||
| <head> | ||
| <meta charset="utf-8" /> | ||
| <meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
| <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> | ||
| <!-- Customer Name Input --> | ||
| <p> | ||
| <label for="customerName">Name:</label> | ||
| <input type="text" id="customerName" name="customerName" required minlength="2" | ||
| pattern=".*\S.*" placeholder="Enter your full name"> | ||
| </p> | ||
|
|
||
| <!-- Customer Email Input --> | ||
| <p> | ||
| <label for="emailAddress">Email:</label> | ||
| <input type="email" id="emailAddress" name="emailAddress" required placeholder="you@example.com" | ||
| pattern="^[a-zA-Z0-9._%+-]+@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+([a-zA-Z]{2,63})$" | ||
| title="Please enter a valid email address (e.g., user@example.com). Domain parts (like 'example') must start and end with a letter or number, can contain hyphens, and must be separated by dots. Ends with a top-level domain (e.g., .com)."> | ||
|
Comment on lines
+28
to
+30
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. Why specify the pattern when the input type is "email"? What difference does the pattern make? When I tested the form, the input field still accepts "a@a" as a valid email. |
||
| </p> | ||
|
|
||
| <!-- T-Shirt Colour Selection --> | ||
| <fieldset> | ||
| <legend>Choose T-Shirt Colour:</legend> | ||
| <p> | ||
| <input type="radio" id="colourRed" name="shirtColour" value="red" required> | ||
| <label for="colourRed">Red</label> | ||
|
Comment on lines
+37
to
+38
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.
Note: If you wrap |
||
| </p> | ||
| <p> | ||
| <input type="radio" id="colourBlue" name="shirtColour" value="blue"> | ||
| <label for="colourBlue">Blue</label> | ||
| </p> | ||
| <p> | ||
| <input type="radio" id="colourGreen" name="shirtColour" value="green"> | ||
| <label for="colourGreen">Green</label> | ||
| </p> | ||
| </fieldset> | ||
|
|
||
| <!-- T-Shirt Size Selection --> | ||
| <p> | ||
| <label for="shirtSize">Choose Size:</label> | ||
| <select id="shirtSize" name="shirtSize" required> | ||
| <option value="">-- Please choose a size --</option> | ||
| <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> | ||
| </p> | ||
|
|
||
| <!-- Submit Section Button --> | ||
| <p> | ||
| <button type="submit">Place Order</button> | ||
| </p> | ||
| </form> | ||
| </main> | ||
| <footer> | ||
| <h2>By Gideon Defar</h2> | ||
| </footer> | ||
| </body> | ||
|
|
||
| </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.
Can you change the pattern so that it can reject names like "A " or " A"? (Name with only one non-space character but with many space characters)