-
-
Notifications
You must be signed in to change notification settings - Fork 499
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
Open
AbidAkhtar-tech
wants to merge
8
commits into
CodeYourFuture:main
Choose a base branch
from
AbidAkhtar-tech:Abid/Sprint1/FormControls
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+167
−25
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
c540b9d
Add my name.
AbidAkhtar-tech 92359a0
Add input for choosing colour
AbidAkhtar-tech 34480d5
Created .css file for styling
AbidAkhtar-tech fa6c242
Add accessible T-shirt order form styling
AbidAkhtar-tech 8f336a0
Changed background color
AbidAkhtar-tech efd979c
Adjust form background styling
AbidAkhtar-tech d00e325
Add regex validation for username input
AbidAkhtar-tech b2a7ad8
Simplify radio button labels
AbidAkhtar-tech File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,94 @@ | ||
| <!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--> | ||
| <p>By HOMEWORK SOLUTION</p> | ||
| </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="" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
| <link rel="stylesheet" href="style.css"> | ||
|
|
||
| </head> | ||
|
|
||
| <body> | ||
| <header> | ||
| <h1>Product T-shirts</h1> | ||
| </header> | ||
| <main> | ||
| <form> | ||
|
|
||
|
|
||
| <!-- 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" pattern=".*\S.*\S.*" 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> | ||
| Red | ||
| <input type="radio" name="colour" value="red" required> | ||
| </label> | ||
|
|
||
| <label> | ||
| Green | ||
| <input type="radio" name="colour" value="green"> | ||
| </label> | ||
|
|
||
| <label> | ||
| White | ||
| <input type="radio" name="colour" value="white"> | ||
| </label> | ||
|
|
||
| </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> | ||
|
|
||
|
|
||
|
|
||
|
|
||
| </form> | ||
| </main> | ||
| <footer> | ||
|
|
||
| <p>Made with love by Abid Akhtar</p> | ||
| </footer> | ||
| </body> | ||
|
|
||
| </html> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Have you wondered whether the text should appear on the left or on the right of the radio button?
Do use an AI tool to research the advantages and disadvantages of placing radio buttons on the left versus the right of their corresponding labels.
No change required.