Skip to content
Open
Changes from 4 commits
Commits
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
252 changes: 227 additions & 25 deletions Form-Controls/index.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,229 @@
<!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>T-Shirt Order</title>
<meta name="description" content="T-Shirt order form" />
<meta name="viewport" content="width=device-width, initial-scale=1" />


<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 0;
min-height: 100vh;
display: flex;
flex-direction: column;
}


header,
footer {
text-align: center;
padding: 1rem;
background-color: #222;
color: white;
}


main {
max-width: 600px;
margin: 2rem auto;
background: white;
padding: 2rem;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
flex: 1;
}


h1,
h2 {
margin-top: 0;
}


section {
margin-bottom: 1.5rem;
}


label {
display: inline-block;
margin-bottom: 0.3rem;
}


input[type="text"],
input[type="email"] {
width: 100%;
padding: 0.5rem;
margin-bottom: 1rem;
border: 1px solid #ccc;
border-radius: 4px;
}


fieldset {
border: 1px solid #ccc;
padding: 1rem;
border-radius: 4px;
}


legend {
font-weight: bold;
}


.radio-group {
display: flex;
flex-direction: column;
gap: 0.5rem;
}


.radio-group div {
display: flex;
align-items: center;
gap: 0.5rem;
}


button {
padding: 0.7rem 1.2rem;
border: none;
border-radius: 4px;
background-color: #0077cc;
color: white;
font-size: 1rem;
cursor: pointer;
}


button:hover {
background-color: #005fa3;
}


footer p {
margin: 0;
}
</style>
</head>


<body>
<header>
<h1>T-shirt Sale</h1>
</header>


<main>
<form>


<!-- Customer Information -->
<section>
<h2>Customer Information</h2>


<p>
<label for="name">Name *</label>
<input type="text" id="name" name="customer-name" required minlength="2" />
</p>


<p>
<label for="email">Email *</label>
<input type="email" id="email" name="customer-email" required />
</p>
</section>


<!-- Colour Selection -->
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Let's look into the colour selection a bit more, specifically the options. Do you see anything that might look off and not fulfil the requirements?

<section>
<h2>T-Shirt Colour *</h2>
<fieldset>
<legend>Select one colour</legend>
<div class="radio-group">
<div>
<input type="radio" id="red" name="colour" value="red" required />
<label for="red">Red</label>
</div>


<div>
<input type="radio" id="black" name="colour" value="black" required />
<label for="black">Black</label>
</div>
Copy link
Copy Markdown
Contributor

@cjyuan cjyuan Feb 22, 2026

Choose a reason for hiding this comment

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

This implementation does not quite meet the requirements specified in README.md. Please check the spec to find out what you missed.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

added 3rd colour section to meet README requirement

       <div>
          <input type="radio" id="blue" name="colour" value="blue" required />
          <label for="blue">Blue</label>
        </div>

</div>
</fieldset>
</section>


<!-- Size Selection -->
<section>
<h2>T-Shirt Size *</h2>
<fieldset>
<legend>Select one size</legend>
<div class="radio-group">
<div>
<input type="radio" id="xs" name="size" value="XS" required />
<label for="xs">XS</label>
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 also consider wrapping the radio button input inside the label tag as:

              <labe>
              <input type="radio" name="size" value="XS" required />
              XS
              </label>

This way, you don't need to use the for and id attribute.

Also, among the radio buttons in the same button group, we don't need multiple required -- one is enough.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

wrapped radio button input inside label tag and removed redundant required, id and for attributes since label wrap inputs

          <label>
            <input type="radio" name="size" value="XS" required /> XS
          </label>

</div>


<div>
<input type="radio" id="s" name="size" value="S" required />
<label for="s">S</label>
</div>


<div>
<input type="radio" id="m" name="size" value="M" required />
<label for="m">M</label>
</div>


<div>
<input type="radio" id="l" name="size" value="L" required />
<label for="l">L</label>
</div>


<div>
<input type="radio" id="xl" name="size" value="XL" required />
<label for="xl">XL</label>
</div>


<div>
<input type="radio" id="xxl" name="size" value="XXL" required />
<label for="xxl">XXL</label>
</div>
</div>
</fieldset>
</section>


<!-- Submit -->
<section>
<button type="submit">Submit Order</button>
</section>
</form>
</main>


<footer>
<p>By MOHAMMED OMER</p>
</footer>
</body>


</html>