-
-
Notifications
You must be signed in to change notification settings - Fork 85
ITP-Jan-25 Cape Town | Jordy Mukandayi | Module-Onboarding | Form-Controls |Week2 #260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
00040de
27c75a0
36f8ca9
7a0df6d
b7969ea
26ba20f
81fc2d4
105a6e7
3210a0a
92d135c
fc99518
9d1fa6e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,25 +3,73 @@ | |
<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="description" | ||
content="T-shirt order form, select t-shirt color, and choose size." | ||
/> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<link rel="stylesheet" href="styles.css" /> | ||
<title>T-Shirt Order Form</title> | ||
</head> | ||
<body> | ||
<header> | ||
<h1>Product Pick</h1> | ||
<header class="header"> | ||
<h1>T-shirt 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 action="" method="POST"> | ||
<div class="label-name"> | ||
<label for="name">Name</label> | ||
<input | ||
type="text" | ||
name="name" | ||
id="name" | ||
placeholder="Enter full name " | ||
required | ||
minlength="2" | ||
/> | ||
</div> | ||
<div class="label-email"> | ||
<label for="email">Email</label> | ||
<input | ||
name="email" | ||
id="email" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You need to ensure that the email is valid There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I changed type="text" to type="email" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good |
||
type="email" | ||
placeholder="Enter your email" | ||
required | ||
/> | ||
</div> | ||
<div class="label-size"> | ||
<label for="size" class="tshirt">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> | ||
<div class="radio"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs to be required There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the select size have the required There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good |
||
<div> | ||
<label for="black">Black</label> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The colors also needs to be required. |
||
<input type="radio" name="color" id="black" value="black" /> | ||
</div> | ||
<div> | ||
<label for="white">White</label> | ||
<input type="radio" name="color" id="white" value="white" /> | ||
</div> | ||
<div> | ||
<label for="blue">Blue</label> | ||
<input type="radio" name="color" id="blue" value="blue" /> | ||
</div> | ||
</div> | ||
<button type="submit">Place Order</button> | ||
</form> | ||
</main> | ||
<footer> | ||
<!-- change to your name--> | ||
<h2>By HOMEWORK SOLUTION</h2> | ||
<h2>By Jordy Mukandayi</h2> | ||
</footer> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
/* body { */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please delete this file |
||
/* margin: 0; | ||
padding: 0; | ||
} */ | ||
.header { | ||
display: flex; | ||
flex-direction: column; | ||
text-align: center; | ||
} | ||
h1 { | ||
margin-top: 20px; | ||
margin-bottom: 1px; | ||
font-weight: bold; | ||
font-size: 30px; | ||
} | ||
/* Label-name */ | ||
form { | ||
display: block; | ||
flex-direction: column; | ||
width: 600px; | ||
background: #f2f2f2; | ||
border: 1px solid #cccccc; | ||
border-radius: 5px; | ||
margin: 20px auto 40px auto; | ||
} | ||
.label-name { | ||
border-radius: 5px; | ||
padding: 18px 20px; | ||
margin: 8px 0; | ||
background: #f2f2f2; | ||
} | ||
input[type="text"], | ||
input[type="date"], | ||
input[type="email"], | ||
select { | ||
width: 92%; | ||
padding: 12px 20px; | ||
margin: 8px 0; | ||
display: flex; | ||
border-radius: 5px; | ||
border: 1px solid #cccccc; | ||
} | ||
label { | ||
font-weight: bold; | ||
font-size: 20px; | ||
} | ||
/* Email */ | ||
.label-email { | ||
padding: 18px 20px; | ||
margin: 8px 0; | ||
background: #f2f2f2; | ||
} | ||
/* T-shirt size */ | ||
.tshirt { | ||
display: flex; | ||
justify-content: left; | ||
padding-left: 20px; | ||
} | ||
#size { | ||
display: center; | ||
justify-content: center; | ||
font-size: 15px; | ||
font-weight: 700px; | ||
margin-left: 25px; | ||
} | ||
/* T-shirt color */ | ||
.radio { | ||
display: flex; | ||
justify-content: center; | ||
padding: 10px 0; | ||
} | ||
/* Button */ | ||
button { | ||
width: 92%; | ||
color: white; | ||
font-weight: 700; | ||
font-size: 20px; | ||
border-radius: 4px; | ||
background: #0019f7; | ||
margin: 8px 26px 20px; | ||
padding: 14px 20px; | ||
display: center; | ||
cursor: pointer; | ||
} | ||
button:hover { | ||
background-color: #926487; | ||
} | ||
/* footer */ | ||
h2 { | ||
text-align: center; | ||
} | ||
/* Responsive styles */ | ||
@media (max-width: 768px) { | ||
header, | ||
header h1, | ||
header p, | ||
form { | ||
float: none; | ||
text-align: center; | ||
width: 100%; | ||
} | ||
input[type="text"], | ||
input[type="date"], | ||
select { | ||
float: none; | ||
text-align: center; | ||
width: 90%; | ||
display: block; | ||
} | ||
button { | ||
float: none; | ||
text-align: center; | ||
width: 100%; | ||
display: center; | ||
margin-left: 1px; | ||
} | ||
#size { | ||
float: none; | ||
text-align: center; | ||
} | ||
.label-size { | ||
text-align: center; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to require a min of 2 char for the name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added minlength="2" for require 2 char
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good