Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
7b41ae7
Added form code
RaeesStevens Sep 13, 2026
e8ae82b
created style.css file and linked to html
RaeesStevens Sep 13, 2026
8ae5858
added a : after Customer email
RaeesStevens Sep 13, 2026
d01406b
added colon after customer email
RaeesStevens Sep 13, 2026
7583afd
updated background colour on CSS
RaeesStevens Sep 13, 2026
6314e87
updated labels and body on CSS
RaeesStevens Sep 13, 2026
831f71a
Updated CSS with select and input fields
RaeesStevens Sep 13, 2026
97df358
changed label font color
RaeesStevens Sep 13, 2026
031dd37
added fieldset styling
RaeesStevens Sep 13, 2026
9823b8e
restarted CSS with heading styling
RaeesStevens Sep 13, 2026
2fca7b5
Testing body and heading styling
RaeesStevens Sep 13, 2026
6a29c30
updated body in CSS
RaeesStevens Sep 13, 2026
70180cc
added legend and fieldset in CSS
RaeesStevens Sep 13, 2026
6406563
trying form CSS layout
RaeesStevens Sep 13, 2026
9e88ab5
centered h1, added button colors
RaeesStevens Sep 13, 2026
1ed6d74
update special label
RaeesStevens Sep 13, 2026
8c3c805
update labels on html
RaeesStevens Sep 13, 2026
8d3ea27
made label font size small
RaeesStevens Sep 13, 2026
942d555
final updates
RaeesStevens Sep 13, 2026
ab37c3b
added pattern for two non-space characters
RaeesStevens Sep 19, 2026
a0b0cba
updated read.me
RaeesStevens Sep 19, 2026
4f2424f
updated read me and CSS
RaeesStevens Sep 19, 2026
dfba1c7
Added inline-blockd isplay to size
RaeesStevens Sep 19, 2026
9cd31c8
Updated submit buttom on html
RaeesStevens Sep 19, 2026
eaa2c1e
Added size label
RaeesStevens Sep 19, 2026
5f4166a
Testing frid display for form
RaeesStevens Sep 19, 2026
38a0689
updated html with div classes
RaeesStevens Sep 19, 2026
783c8ce
Added margin-bottom to classes in CSS
RaeesStevens Sep 19, 2026
8b2150b
Added size-row to CSS
RaeesStevens Sep 19, 2026
a0c9d78
Updted css with form border and fieldset margin and min-width
RaeesStevens Sep 19, 2026
d40d37b
updated css
RaeesStevens Sep 19, 2026
71dc183
Added styling for input element for submit button
RaeesStevens Sep 19, 2026
3e12963
add container class in html adn CSS
RaeesStevens Sep 19, 2026
f508efd
added bottom-margin to size-row
RaeesStevens Sep 19, 2026
6d780ec
centered p
RaeesStevens Sep 19, 2026
ea60e41
made border for form larger
RaeesStevens Sep 19, 2026
39d6f9a
Added max width for form
RaeesStevens Sep 19, 2026
dadd27a
updated CSS
RaeesStevens Sep 19, 2026
a108fe8
remvoed amx-width from form
RaeesStevens Sep 19, 2026
52ff742
updated max-width of container to 500px
RaeesStevens Sep 19, 2026
4c661e4
fix footer p naming on css
RaeesStevens Sep 19, 2026
80ab52b
added box-sizing to form
RaeesStevens Sep 19, 2026
e7daaa2
updated form display
RaeesStevens Sep 19, 2026
3f082e9
updated container to wrap entire form in html
RaeesStevens Sep 19, 2026
cfe2fb3
updated font size
RaeesStevens Sep 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions Form-Controls/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

<!--{{<objectives>}}>-->

- [ ] Interpret requirements and check against a list of criteria
- [ ] Write a valid form
- [ ] Test with Devtools
- [ ] Refactor using Devtools
- [ ] Use version control by committing often and pushing regularly to GitHub
- [ ] Develop the habit of writing clean, well-structured, and error-free code
- [x] Interpret requirements and check against a list of criteria
- [x] Write a valid form
- [x] Test with Devtools
- [x] Refactor using Devtools
- [x] Use version control by committing often and pushing regularly to GitHub
- [x] Develop the habit of writing clean, well-structured, and error-free code
<!--{{<objectives>}}>-->

## Task
Expand Down Expand Up @@ -39,18 +39,18 @@ Do not write a form action for this project.

Let's write out our testable criteria. Check each one off as you complete it.

- [ ] I have only used HTML and CSS.
- [ ] I have not used any JavaScript.
- [x] I have only used HTML and CSS.
- [x] I have not used any JavaScript

### HTML

- [ ] My form is semantic HTML.
- [ ] All inputs have associated labels.
- [ ] My Lighthouse Accessibility score is 100.
- [ ] I require a valid name.
- [ ] I require a valid email.
- [ ] I require one colour from a defined set of 3 colours.
- [ ] I require one size from a defined set of 6 sizes.
- [x] My form is semantic HTML.
- [x] All inputs have associated labels.
- [x] My Lighthouse Accessibility score is 100.
- [x] I require a valid name.
- [x] I require a valid email.
- [x] I require one colour from a defined set of 3 colours.
- [x] I require one size from a defined set of 6 sizes.

### Developers must adhere to professional standards.

Expand All @@ -59,10 +59,10 @@ Let's write out our testable criteria. Check each one off as you complete it.
These practices reflect the level of quality expected in professional work.
They ensure your code is reliable, maintainable, and presents a polished, credible experience to users.

- [ ] My HTML code has no errors or warnings when validated using https://validator.w3.org/
- [ ] My code is consistently formatted
- [ ] My page content is free of typos and grammatical mistakes
- [ ] I commit often and push regularly to GitHub
- [x] My HTML code has no errors or warnings when validated using https://validator.w3.org/
- [x] My code is consistently formatted
- [x] My page content is free of typos and grammatical mistakes
- [x] I commit often and push regularly to GitHub

## Resources
- [MDN: Form controls](https://developer.mozilla.org/en-US/docs/Learn/Forms)
Expand Down
49 changes: 47 additions & 2 deletions Form-Controls/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,67 @@
<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>
</header>
<main>
<div class="container">
<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>
<div class="field-row">
<label for="name">Customer Name:</label>
<input type="text" id="name" minlength="2" pattern=".*\S.*\S.*" required>

<label for="email">Customer Email:</label>
<input type="email" id="email" name="email" required>
</div>

<fieldset>
<legend>T-shirt color:</legend>

Comment on lines +29 to +33

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation is not consistent.

Suggestion:

  • Look up the benefits of using a code formatter.
  • Install the Prettier extension for VS Code, then:
    • Use VS Code's Format Document feature to format your code.
    • Optionally, enable Format On Save and Format On Paste to keep your code consistently formatted.

Resource: Visual Studio Code - Formatting

Note: The formatter may not work correctly if your code contains syntax errors.

<div class="color-options">
<input type="radio" id="blue" name="color" value="blue" required>
<label for="blue">Blue</label>

<input type="radio" id="black" name="color" value="black" required>
<label for="black">Black</label>

<input type="radio" id="grey" name="color" value="grey" required>
<label for="grey">Grey</label>
</div>
Comment on lines +34 to +43

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you use an AI tool to find out how the code on lines 35-42 could be simplified?


<div class="size-row">
<label for="size">Size</label>
<select id="size" name="size" required>

<option value="">--select 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>
</div>

<input type="submit" value="Submit">

</fieldset>
</div>

</form>
</div>
</main>
<footer>
<!-- change to your name-->
<p>By HOMEWORK SOLUTION</p>
<p>By Raees Stevens</p>
</footer>
</body>
</html>
45 changes: 45 additions & 0 deletions Form-Controls/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
h1 {
text-align: center;
}

footer p {
text-align: center;
}
.container {
max-width: 700px;
margin: 2em auto;
padding: 1em;
font-size: 1.2em;
}

form {
display: block;
border: 1px solid #3333;
border-radius: 1em;
box-sizing: border-box;
width: 100%;
}

.field-row {
margin-bottom: 1em;
display: block;
}

.color-options {
margin-bottom: 0.75em;
}
.size-row {
margin-top: 0.5em;
margin-bottom: 0.5em;
}

input[type="submit"] {
display: block;
margin-top: 0.75em;
}

fieldset {
margin: 2em 5;
min-width:250px;
}

Loading