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
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
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 />
Comment on lines +30 to +31
Copy link
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.

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