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
87 changes: 76 additions & 11 deletions Form-Controls/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,85 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
</head>
<body>
<header>
<h1>Product Pick</h1>
<header>T-shirt Order Form
<h1>T-shirt Order Form</h1>
Comment on lines +11 to +12
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.

Why made "T-shirt Order Form" to appear twice?

</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>
<!-- Name -->
<label for="name">Full Name</label>
<input
type="text"
id="name"
required
minlength="5"
>
Comment on lines +17 to +23
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.

This input element does not yet fully meet the requirement:

  • Must be at least 2 characters long
  • Cannot be empty

Currently, string such as "CJ" would be rejected but a string containing exactly 5 space characters would be accepted.


On separate note, can you use an AI to find out "In HTML, what is a placeholder attribute and why using it in input element is considered a good practice?"


<!--EMAIL ADDRESS" -->
<label for="email">Email Address</label>
<input
type="email"
id="email"
name="email"
required
>

<!-- COLOUR -->
<p>Choose a colour:</p>

<label>
<input type="radio" name="colour" value="pink" required>
Pink
</label>

<label>
<input type="radio" name="colour" value="black" required>
Black
</label>

<label>
<input type="radio" name="colour" value="blue" required>
Blue
</label>
Comment on lines +37 to +50
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.

Note: For radio buttons within the same group, it is sufficient to mark only one of them as required.


<!-- SIZE -->
<label for="size">SIZE</label>
<select id="size" name="size" required>
<option value="">-- Select Size --</option>
<option value="XS">XS</option>
Comment on lines +52 to +56
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 layout of the colour and size controls feels a bit unbalanced. The colour options are presented as a radio group, while the size selector appears immediately afterward without a similar grouping structure. Consider reorganizing these controls (for example, using <fieldset> and <legend> elements) to make the form easier to scan and more visually consistent.

Image

<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>

<!--
FORM REQUIREMENTS:
1. Collect customer's full name
- Must be at least 2 characters long
- Cannot be empty

2. Collect customer's email
- Must be a valid email format
- Field is required

3. Choose T-shirt colour
- Must select ONE option only
- Only 3 allowed options provided
- Cannot enter custom colours

4. Choose T-shirt size
- Must select ONE option
- Options: XS, S, M, L, XL, XXL
- Field is required

5. All fields are required before submission

6. No JavaScript allowed... only HTML form validation
-->
<!-- change to your name-->
<p>By HOMEWORK SOLUTION</p>
<p>By Juanita Nwachukwu</p>
</footer>
</body>
</html>
</html>
Loading