Skip to content
Closed
Show file tree
Hide file tree
Changes from 14 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
83 changes: 58 additions & 25 deletions Form-Controls/index.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,60 @@
<!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>
<html lang="en"User-agent: *

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.

What does <html lang="en"User-agent: * Allow: /> mean?

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.

oh my bad. I was auto complete.

Allow: />
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>My form control</title>
<link rel="stylesheet" href="style.css"/>
<meta name="description" content="F" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
</head>
<body>
<header>
<h1></h1>
</header>

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.

What is this header doing? There's no text here. Empty elements should be removed

<main>
<form >
<div>
<label for="name">Name:</label>
<input type="text" id="name" name="name"
pattern="^\s*(\S\s*){2,}$" />
</div>

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

<fieldset>
<legend>Please select your color</legend>

<input type="radio" id="black" name="color" value="Black">
<label for="black">Black</label>

<input type="radio" id="beige" name="color" value="Beige">
<label for="beige">Beige</label>

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

<div>
<p>Please select a size</p>

<label for="size">Choose a size:</label>
<select name="size" id="size">
<option value="xs">Extra Small</option>
<option value="small">Small</option>
<option value="medium">Medium</option>
<option value="large">Large</option>

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.

It could be useful here to have a default select option so that the form doesn't default to picking a size accidentally. E.g. if i don't pick a size, the form will submit XS but I might not want XS. It would be better to have a default value that doesn't let the user submit and forces them to select a size.

</select>
</div>

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.

How come you decided not to wrap this section in a fieldset tag but you wrapped lines 30 - 41 in a fieldset tag?

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 I think I have fixed the issues.

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.

Could you please review my PR so I can submit the enrollment form.


<input type="submit" value="Submit">

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.

I would have expected this to be a submit button
This tag is also not closed.

</form>
</main>
<footer>From control by Mandip sanger</footer>
</body>
</html>
88 changes: 88 additions & 0 deletions Form-Controls/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
header {
background-color: #49bb93;
color: white;
text-align: center;
padding: 20px;
}
h1 {
margin: 0;
}
fieldset {
margin-bottom: 20px;
padding: 15px;
border: 1px solid #bbb;
border-radius: 4px;
}
legend {
font-weight: bold;
padding: 05px;
}

fieldset input[type="radio"] {
margin-right: 5px;
}

fieldset label {
display: inline;
margin-right: 15px;
font-weight: normal;
}

body {
font-family: Arial, sans-serif;
background-color: #f5f7fa;
margin: 0;
padding: 0;
color: #333;
}
main {
display: flex;
justify-content: center;
padding: 30px 15px;
}
form {
background-color: white;
padding: 25px;
width: 100%;
max-width: 500px;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
div {
margin-bottom: 20px;
}
label {
display: flex;
margin-bottom: 5px;
font-weight: bold;
}
input[type="text"],
input[type="email"],
select {
width: 100%;
padding: 10px;
border: 1px solid #bbb;
border-radius: 4px;
font-size: 1rem;
}
input[type="submit"] {
width: 100%;
background-color: #49bb93;
color: white;
border: none;
padding: 12px;
border-radius: 4px;
font-size: 1rem;
cursor: pointer;
}

input[type="submit"]:hover {
background-color: #49bb93;
}
footer {
text-align: center;
background-color: #49bb93;
color: white;
padding: 15px;
margin-top: 20px;
}
Loading