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
38 changes: 32 additions & 6 deletions Form-Controls/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,41 @@ <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">Customer Name:</label>
<input type="text" id="name" name="name" required pattern=".*\S.*\S.*" title="Name must contain at least two characters.">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Well done this also works with special characters like the German ä,ü,ö or Russian ед

</div>
<label for="email">Email Address:</label>
<input for="email" id="email" name="email" required>
</div>
<div>
<label for="Colour">Choose a Colour</label>
<select id="name" name="colour" required >
<option value="">Please choose colour:</option>
<option value="White">White</option>
<option value="Black">Black</option>
<option value="Green">Green</option>
</select>
</div>
<div>
<label for="size">Choose a size</label>
<select id="size" name="size">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

How can you ensure that the user chooses a size before submitting the form?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

By using the required attribute in the input tag

<option value="">Please choose 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>
<div>
<button type="submit">Submit</button>
</div>
</form>
</main>
<footer>
<!-- change to your name-->
<p>By HOMEWORK SOLUTION</p>
<p>By SIMA NONGAWUZA</p>
</footer>
</body>
</html>
Loading