Skip to content
Open
Changes from all 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
58 changes: 53 additions & 5 deletions Form-Controls/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,64 @@
<h1>Product Pick</h1>
</header>
<main>
<form>
<!-- write your html here-->
<form>
<label for="name">Name:</label>
<input type="text" id="name" name="name" required
minlength="2" pattern="^[A-Za-z ]{2,}$"
title="Name must be at least 2 letters and contain only letters"
/>
<br /><br />
<label for="email">Email:</label>
<input type="email" id="email" name="email" placeholder="name@example.com" required />
<br /><br />
<fieldset>
<legend>Please select a color:</legend>
<input type="radio" id="black" name="color" value="black" />
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

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

The radio buttons for color selection should have the required attribute to enforce that users make a selection. Since all fields are required per the specification, at least one radio button in the group should be marked as required to ensure a color is selected before form submission.

Suggested change
<input type="radio" id="black" name="color" value="black" />
<input type="radio" id="black" name="color" value="black" required />

Copilot uses AI. Check for mistakes.
<label for="black">black</label>
<br />
<br />
<input type="radio" id="blue" name="color" value="blue" />
<label for="blue">blue</label>
<br />
<br />
<input type="radio" id="red" name="color" value="red" />
<label for="red">red</label>
<br />
<br />
</fieldset>
<br /> <br />
<label for="size">Please select a size:</label>
<select id="size" name="size" required>
<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>
Comment on lines +42 to +49
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

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

The size dropdown should include a default placeholder option to ensure users actively select a size. Consider adding a first option like "Select a size" with an empty value and the disabled and selected attributes, so that the required attribute properly enforces selection.

Copilot uses AI. Check for mistakes.
<br /><br />
<button type="submit">Submit</button>
</form>



<!--
try writing out the requirements first as comments
this will also help you fill in your PR message later-->
We are selling t-shirts. Write a form to collect the following data:
Our customers already have accounts, so we know their addresses and charging details already. We don't need to collect that data. We want to confirm they are the right person, then get them to choose a colour and size.
Writing that out as a series of questions to ask yourself:
What is the customer's name? I must collect this data, and validate it. But what is a valid name? I must decide something.
What is the customer's email? I must make sure the email is valid. Email addresses have a consistent pattern.
What colour should this t-shirt be? I must give 3 options. How will I make sure they don't pick other colours?
What size does the customer want? I must give the following 6 options: XS, S, M, L, XL, XXL
All fields are required. Do not write a form action for this project.-->
</form>
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

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

Duplicate closing form tag detected. The form is already closed on line 52, so this closing tag should be removed to avoid invalid HTML structure.

Suggested change
</form>

Copilot uses AI. Check for mistakes.
</main>
<footer>
<!-- change to your name-->
<h2>By HOMEWORK SOLUTION</h2>
<h2>Oussama Mouggal</h2>
</footer>
</body>
</html>
Loading