Skip to content
55 changes: 48 additions & 7 deletions Form-Controls/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,57 @@
<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>
<section>

<div>
<label for="name"> Name*: </label>
<input type="text" id="name" name="name" required minlength="2">
</div>

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


<fieldset>
<legend >t-shirt Color</legend>
<div>
<label for="black" required>Black</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.

The required attribute only applies to form input elements, not labels.

<input type="radio" id="black" name="t-shirt-color" value="black">

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.

Currently, the radio button name is placed before the radio button input. For better UX, try placing the radio button before the label.

</div>
<div>
<label for="red">Red </label>
<input type="radio" id="red" name="t-shirt-color" value="red">
</div>
<div>
<label for="green">Green </label>
<input type="radio" id="green" name="t-shirt-color" value="green">
</div>
</fieldset>


<div>
<label for="T-shirt-size" >T-Shirt Size</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.

The for attribute must exactly match the id attribute (case-sensitive). These don't match, so the label won't be properly associated with the select element.

<select name="T-shirtSize" id="T-shirtSize" required>
<option value="XS">XS</option>
<option label="S" value="S">S</option>
<option label="M" value="M">M</option>
<option label="L" value="L">L</option>
<option label="XL" value="XL">XL</option>
<option label="XXL" value="XXL">XXL</option>
</select>
</div>
<div>
<button type="submit">Place your order</button>
</div>
</section>
</form>
</main>
<footer>
<!-- change to your name-->
<h2>By HOMEWORK SOLUTION</h2>

<p>By Ebraim Moqbel</p>
</footer>
</body>
</html>