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
62 changes: 55 additions & 7 deletions Form-Controls/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,63 @@ <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-->
</form>
<fieldset>
<legend>Order your custom T‑shirt</legend>

<label for="name">Customer Name:</label>
<input
type="text"
id="name"
name="name"
required
minlength="3"
placeholder="Enter your full name">

<br><br>

<label for="email">Email Address:</label>
<input
type="email"
id="email"
name="email"
required
placeholder="example@email.com"
minlength="8">

<br><br>

<label for="colour">T‑shirt Colour:</label>

Choose a reason for hiding this comment

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

Well done for the good job.
are you able to find a way to validate the (dropdown menu) ? is there a way to use "value" for the each option of the select element? Does this affect the required attribute? see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/select Additional research - (may not be required) see below: can you use input with pattern for validation in this case too and datalist validation? see this page may be of help https://developer.mozilla.org/en-US/docs/Learn_web_development/Extensions/Forms/Form_validation

Copy link
Author

Choose a reason for hiding this comment

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

I misunderstood it at first, i thought im not using get or post actions neither am i connected to server so i didnt thought of adding the value to options, my bad, fixed it now.

<select id="colour" name="colour" required>
<option value="">Choose a colour</option>
<option value="red">Red</option>
<option value="blue">Blue</option>
<option value="black">Black</option>
</select>

<br><br>

<label for="size">T‑shirt Size:</label>
<select id="size" name="size" required>
<option value="">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>

<br><br>

<button type="submit">Submit Order</button>
</fieldset>

</form>

</main>
<footer>
<!-- change to your name-->
<h2>By HOMEWORK SOLUTION</h2>

<h2>By Said Fayaz Sadat</h2>
</footer>
</body>
</html>