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
69 changes: 61 additions & 8 deletions Form-Controls/index.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,80 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>My form exercise</title>
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<header>
<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-->
<!-- Customer's name -->
<div>
<label for="name">Full Name:</label><br>
<input type="text" id="name" name="name" mainlength="2" pattern=".*\S.*" title="Name must be 2 characters cannot contain only spaces" required><br>
Comment on lines +19 to +20
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 minimum character length wasn't working for me - I was able to submit a form with a name of "P", please take another look at this

</div>

<!-- Email -->
<div>
<label for="email">Email Address:</label><br>
<input type="email" id="email" name="email" required autocomplete="email"><br><br>
</div>

<!-- T-shirt Color -->
<fieldset>
<legend>Choose a T-shirt Color:</legend>

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


<label>
<input type="radio" name="color" value="blue" required>
Blue
</label>


<label>
<input type="radio" name="color" value="green" required>
Green
</label>

</fieldset>
Comment on lines +30 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.

For your "name" tags here, I would consider being more descriptive for future projects. If this represents data we want to be clear what the data is - here, colour alone is ok for now, but if we add other colour options (e.g. colour of the design on the t shirt, not just the t shirt itself) we might need this name tag to be "tshirt-colour"


<!-- Size -->
Comment on lines +30 to +52
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.

Spacing here is odd. I would be careful to either use a linter like Prettier to format your code before you submit or make sure you take out unnecessary spaces before you commit code to a repo

<div>
<label for="size">Select Size:</label>
<select id="size" name="size" required>
<option value="">--Select a Size--</option>
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.

Good use of a initial default value

<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>
Comment on lines +54 to +63
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.

could wrap this in a fieldset tag

</div>

<!-- Submit -->
<div>
<button type="submit">Submit</button>
</div>
</form>
</main>

<footer>
<!-- change to your name-->
<p>By HOMEWORK SOLUTION</p>
</footer>
</body>
</html>


Loading