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
50 changes: 48 additions & 2 deletions Form-Controls/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<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>
Expand All @@ -16,12 +17,57 @@ <h1>Product Pick</h1>
<!-- write your html here-->
<!--
try writing out the requirements first as comments
this will also help you fill in your PR message later-->
this will also help you fill in your PR message later

requirements
-What is the customer's name? I must collect this data and ensure it contains at least two non-space characters
-What is the customer's email? I must make sure the email is valid. Email addresses follow a consistent pattern
-What colour should this T-shirt be? I must provide 3 options. How will I ensure they do not choose other colours?
-What size does the customer want? I must provide the following 6 options: XS, S, M, L, XL, XXL -->
<fieldset>
<legend>Customer Information</legend>
<p>
<label for="customerName">Customer Name</label>
<input id="customerName" name="customerName" type="text" pattern=".*\S.*\S.*" required>
</p>
<p>
<label for="emailAddress">Email Address</label>
<input id="emailAddress" name="emailAddress" type="email" required>
</p>
</fieldset>
<fieldset>
<legend>T-shirt Colour and Size</legend>
<p>
<label for="red">Red</label>
<input type="radio" id="red" name="colour">
</p>
<p>
<label for="green">Green</label>
<input type="radio" id="green" name="colour">
</p>
<p>
<label for="blue">Blue</label>
<input type="radio" id="blue" name="colour">
</p>
<p>
<label for="size">Tshirt Size</label>
<select id="size" name="size">
<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>
</p>

</fieldset>

</form>
</main>
<footer>
<!-- change to your name-->
<p>By HOMEWORK SOLUTION</p>
<p>By AKLILU MIHTSUN</p>
</footer>
</body>
</html>
61 changes: 61 additions & 0 deletions Form-Controls/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
body {
font-family: Arial, sans-serif;
background-color: #f2f2f2;
margin: 0;
}

header {
background-color: #333;
color: white;
text-align: center;
padding: 20px;
}

header h1 {
margin: 0;
}

main {
max-width: 600px;
margin: 30px auto;
padding: 0 20px;
}

fieldset {
background-color: white;
border: 1px solid #ccc;
border-radius: 8px;
padding: 20px;
margin-bottom: 20px;
}

legend {
font-weight: bold;
padding: 0 20px;
}

fieldset p {
margin-bottom: 15px;
}

input[type="text"],
input[type="email"] {
display: block;
width: 100%;
box-sizing: border-box;
padding: 10px;
margin-top: 6px;
border: 1px solid #bbb;
border-radius: 5px;
}


select {
padding: 10px;
border: 1px solid #bbb;
border-radius: 5px;
margin-left: 10px;
}
footer{
font-weight: bold;
}
Loading