Skip to content
Closed
Changes from 1 commit
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
51 changes: 46 additions & 5 deletions Form-Controls/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,56 @@ <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-->

<div>
<label for="name">Name</label>
<input type="text" name="name" id="name" placeholder="username" minlength="2" required/>
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 a user can enter a name consisting of only space characters (e.g., " "). Can you enforce a stricter validation rule using the pattern attribute to disallow any name that contains only space characters?

</div>

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

<fieldset>
<legend>Choose a Colour </legend>
<div>
<label for="red">Red</label>
<input type="radio" name="colour" id="red" value="red" required />
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.

Can consider wrapping the input element inside the label tags:

            <label>
              Red
              <input type="radio" name="colour" value="red" required />
            </label>

This way, we don't need to use the id and for attributes.

Copy link
Copy Markdown
Author

@gloriamanks gloriamanks Feb 5, 2026

Choose a reason for hiding this comment

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

Hi @cjyuan ,

Below are the changes i have made according to the feedback given:

  • I’ve wrapped the colour inputs inside their labels
  • I’ve also added additional requirements to the name field to prevent the issue " " referred.

Regarding the remaining Lighthouse warning, without using CSS it isn’t possible to increase the physical size of form controls, so I’ve applied the best possible HTML-only solution. According to the bot, however, this scores 100 on Accessibility
image

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.

Netlify may be using a different version of Lighthouse or different settings when calculating the accessibility score. I think the browser's score is more reliable.

The no-CSS requirement is unusual in practice, but the fix is not difficult (and a bit silly). Just think of it as a puzzle.
Can you try any of the following options to reach a browser's Lighthouse accessibility score of 100?

  1. Use CSS (I will accept the use of CSS), or
  2. Ask ChatGPT "How to overcome the 'Touch targets do not have sufficient size or spacing' problem without using CSS".

</div>

<div>
<label for="Green">Green</label>
<input type="radio" name="colour" id="Green" value="Green" />
</div>

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


<div>
<label for="Sizes">Size</label>
<select name="Size" id="Sizes" 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>

<button type="reset">Reset</button>
<button type="submit">Submit</button>
</form>
</main>
<footer>
<!-- change to your name-->
<h2>By HOMEWORK SOLUTION</h2>
<h2>By GLORIA MANKRADO</h2>
</footer>
</body>
</html>
Loading