-
-
Notifications
You must be signed in to change notification settings - Fork 493
Manchester | 26-ITP-May| Abid Akhtar| Sprint 1| Form Controls #1358
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
c540b9d
92359a0
34480d5
fa6c242
8f336a0
efd979c
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,82 @@ | |
| <title>My form exercise</title> | ||
| <meta name="description" content="" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
| <link rel="stylesheet" href="style.css"> | ||
|
|
||
| </head> | ||
| <body> | ||
| <header> | ||
| <h1>Product Pick</h1> | ||
| <h1>Product T-shirts</h1> | ||
| </header> | ||
| <main> | ||
| <form> | ||
| <!-- write your html here--> | ||
|
|
||
| <!-- 1. What is the customer's name? I must collect this data and ensure it contains at least two non-space characters. --> | ||
|
|
||
| <label for="username">Name</label> | ||
| <input type="text" id="username" minlength="2" required autocomplete="name"> | ||
|
|
||
| <!-- 2. What is the customer's email? I must make sure the email is valid. Email addresses follow a consistent pattern. --> | ||
|
|
||
| <label for="email">Email</label> | ||
| <input type="email" id="email" required autocomplete="email"> | ||
|
|
||
| <!-- 3. What colour should this T-shirt be? I must provide 3 options. How will I ensure they do not choose other colours? --> | ||
|
|
||
| <fieldset> | ||
| <legend>Choose a colour</legend> | ||
|
|
||
| <label for="red">Red</label> | ||
| <input type="radio" id="red" name="colour" value="red" 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. Could consider enclosing This way, you don't have to introduce |
||
|
|
||
| <label for="green">Green</label> | ||
| <input type="radio" id="green" name="colour" value="green"> | ||
|
|
||
| <label for="white">White</label> | ||
| <input type="radio" id="white" name="colour" value="white"> | ||
|
|
||
|
|
||
| </fieldset> | ||
|
|
||
| <!-- 4. What size does the customer want? I must provide the following 6 options: XS, S, M, L, XL, XXL --> | ||
|
|
||
| <fieldset> | ||
| <legend>Choose a size</legend> | ||
|
|
||
| <label for="xs">XS</label> | ||
| <input type="radio" id="xs" name="size" value="xs" required> | ||
|
|
||
| <label for="s">S</label> | ||
| <input type="radio" id="s" name="size" value="s" required> | ||
|
|
||
| <label for="m">M</label> | ||
| <input type="radio" id="m" name="size" value="m" required> | ||
|
|
||
| <label for="l">L</label> | ||
| <input type="radio" id="l" name="size" value="l" required> | ||
|
|
||
| <label for="xl">XL</label> | ||
| <input type="radio" id="xl" name="size" value="xl" required> | ||
|
|
||
| <label for="xxl">XXL</label> | ||
| <input type="radio" id="xxl" name="size" value="xxl" required> | ||
|
|
||
|
|
||
| </fieldset> | ||
|
|
||
| <button type="submit">Submit</button> | ||
|
|
||
|
|
||
|
|
||
| <!-- | ||
| try writing out the requirements first as comments | ||
| this will also help you fill in your PR message later--> | ||
|
Comment on lines
77
to
79
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. Feel free to delete any unnecessary code to keep your code base clean. |
||
| </form> | ||
| </main> | ||
| <footer> | ||
| <!-- change to your name--> | ||
| <p>By HOMEWORK SOLUTION</p> | ||
| <p>Made with love by Abid Akhtar</p> | ||
| </footer> | ||
| </body> | ||
| </html> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| body { | ||
| font-family: Arial, sans-serif; | ||
| margin: 0; | ||
| padding: 20px; | ||
| background-color: beige; | ||
| } | ||
|
|
||
| header, | ||
| footer { | ||
| text-align: center; | ||
| margin-bottom: 20px; | ||
| } | ||
|
|
||
| h1 { | ||
| margin-bottom: 10px; | ||
| } | ||
|
|
||
| main { | ||
| display: flex; | ||
| justify-content: center; | ||
| } | ||
|
|
||
| form { | ||
| background-color: white; | ||
| padding: 20px; | ||
| border-radius: 8px; | ||
| width: 100%; | ||
| max-width: 450px; | ||
|
|
||
| display: flex; | ||
| flex-direction: column; | ||
| gap: 16px; | ||
| } | ||
|
|
||
| label { | ||
| font-weight: bold; | ||
| } | ||
|
|
||
| input[type="text"], | ||
| input[type="email"] { | ||
| width: 100%; | ||
| padding: 10px; | ||
| font-size: 16px; | ||
| box-sizing: border-box; | ||
| } | ||
|
|
||
| fieldset { | ||
| border: 1px solid #ccc; | ||
| padding: 16px; | ||
| } | ||
|
|
||
| legend { | ||
| font-weight: bold; | ||
| padding: 0 6px; | ||
| } | ||
|
|
||
| fieldset label { | ||
| font-weight: normal; | ||
| margin-right: 6px; | ||
| } | ||
|
|
||
| fieldset input[type="radio"] { | ||
| margin-right: 16px; | ||
| margin-bottom: 10px; | ||
| } | ||
|
|
||
| button { | ||
| padding: 12px; | ||
| font-size: 16px; | ||
| cursor: pointer; | ||
| } | ||
|
|
||
| footer p { | ||
| font-size: 14px; | ||
| } |
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 update this input element so that it can reject name containing only space characters? For example,
" "(a string made up of two space characters)?Note:
Your branch is one commit behind the upstream repo (CYF's
main). If you use the "Sync fork" feature on your repo on GitHub to update your branch, you will find in the README.md of this exercise a regular expression that can be used to enforce "name contains at least two non-space characters".