Skip to content
Open
Show file tree
Hide file tree
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
95 changes: 87 additions & 8 deletions Form-Controls/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,101 @@
<title>My form exercise</title>
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="style.css">

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

<div>
<label for="name">Name</label>
<input
type="text"
name="name"
id="name"
Comment on lines +22 to +25

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.

Chrome's "Developer tools" identified this possible improvement:

Image

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.

Updated to include the autocomplete attribute. Thanks for the suggestion!

placeholder="Username"
autocomplete="name"
pattern=".*\S.*\S.*"
title="Please enter at least two non-space characters."
required
/>
</div>

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



<legend>T-shirt Color</legend>


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

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

<div>
<label for="pink">Pink</label>
<input
type="radio"
name="color"
id="pink"
value="Pink"
/>
</div>

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


<div>
Comment on lines +89 to +95

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.

Indentation is off.

Suggestion:

  • Look up the benefits of using a code formatter.
  • Install the Prettier extension for VS Code, then:
    • Use VS Code's Format Document feature to format your code.
    • Optionally, enable Format On Save and Format On Paste to keep your code consistently formatted.

Resource: Visual Studio Code - Formatting

Note: The formatter may not work correctly if your code contains syntax errors.

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.

Thanks for spotting that! I have corrected the indentation.

<button type="reset">Reset</button>
<button type="submit">Submit</button>
</div>
</form>
</main>

<footer>
<!-- change to your name-->
<p>By HOMEWORK SOLUTION</p>
<p>By Perrila Tamang</p>
</footer>
</body>
</html>
</html>
11 changes: 11 additions & 0 deletions Form-Controls/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

button,
select {
min-height: 44px;
padding: 8px 12px;
}

button {
margin-right: 8px;
}

Loading