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: 70 additions & 25 deletions Form-Controls/index.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,72 @@
<!DOCTYPE html>
<html lang="en">
<head>
<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" />
</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-->
</form>
</main>
<footer>
<!-- change to your name-->
<p>By HOMEWORK SOLUTION</p>
</footer>
</body>
</html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>T-Shirt Order Form</title>

<meta name="description" content="Order a T-shirt by entering your details and selecting a colour and size.">
<meta name="robots" content="index, follow">

<link rel="stylesheet" href="style.css">
</head>

<body>

<main>
<form>
<h1>T-Shirt Order Form</h1>

<div class="form-group">
<label for="name">Full Name</label>
<input
type="text"
id="name"
name="name"
required
minlength="2"
pattern=".*\S.*"
>
Comment on lines +23 to +30

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 input field could accept an input such as " A" (a space and an alphabet) even though the input contains only one non-space character. Can you update the code so that it meets the requirement?

</div>

<div class="form-group">
<label for="email">Email Address</label>
<input
type="email"
id="email"
name="email"
required
>
</div>

<div class="form-group">
<label for="colour">Choose a Colour</label>
<select id="colour" name="colour" required>
<option value="">Select a colour</option>
<option value="black">Black</option>
<option value="white">White</option>
<option value="blue">Blue</option>
</select>
</div>

<div class="form-group">
<label for="size">Choose a Size</label>
<select id="size" name="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>

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

</form>
</main>

</body>
</html>
55 changes: 55 additions & 0 deletions Form-Controls/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}

body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}

form {
background-color: white;
padding: 30px;
border-radius: 10px;
width: 350px;
}

h1 {
text-align: center;
margin-bottom: 20px;
}

.form-group {
margin-bottom: 15px;
}

label {
display: block;
margin-bottom: 5px;
font-weight: bold;
}

input,
select {
width: 100%;
padding: 10px;
}

button {
width: 100%;
padding: 10px;
border: none;
background-color: black;
color: white;
cursor: pointer;
}

button:hover {
background-color: #333;
}
Loading