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
69 changes: 47 additions & 22 deletions Form-Controls/index.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,52 @@
<!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" />
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>T-Shirt Order Form</title>
<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-->
</form>
</main>
<footer>
<!-- change to your name-->
<p>By HOMEWORK SOLUTION</p>
</footer>
</body>
<body>
<main class="container">
<h1>T-Shirt Order Form</h1>

<form>
<div>
<label for="name">Full Name</label>
<input type="text" id="name"name="name" minlength="2" pattern=".*\S.*\S.*" placeholder="Enter your full name" required>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Input validation done
placeholder use

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.

All the requested changes are implemented!

</div>

<div>
<label for="email">Email Address</label>
<input type="email" id="email" name="email" placeholder="Enter your email" required>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Correct Input type and required is used .
can you tell how to validate email without using email type

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.

Thank you for the feedback. Since the assignment was limited to HTML and CSS, I used type="email" with the required attribute for built-in browser validation.

</div>

<div>
<label for="colour">T-Shirt 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>
<label for="size">T-Shirt 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">Place Order</button>
</form>
</main>

</body>
</html>
49 changes: 49 additions & 0 deletions Form-Controls/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 40px;
}
.container {
max-width: 500px;
margin: 0 auto;
background-color: #ffffff;
padding: 30px;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
h1 {
text-align: center;
margin-bottom: 24px;
}
form {
display: flex;
flex-direction: column;
gap: 20px;
}
label {
display: block;
margin-bottom: 6px;
font-weight: bold;
}
input,
select {
width: 100%;
padding: 10px;
border: 1px solid #cccccc;
border-radius: 4px;
font-size: 16px;
box-sizing: border-box;
}
button {
padding: 12px;
border: none;
background-color: #000000;
color: white;
font-size: 16px;
border-radius: 4px;
cursor: pointer;
}
button:hover {
background-color: #2d758b;
}
Loading