Skip to content
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

London|Phone Naing|Module-User-Focus-Data-Form|Week2 #307

Closed
wants to merge 2 commits into from
Closed
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
18 changes: 18 additions & 0 deletions Form-Controls/formcontrolchecklist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Developers must test their work

## Let's write out our testable criteria:

### HTML
- [X ] I have used **HTML** and **CSS** only.
- [ X] My form is **semantic HTML**.
- [ X] All inputs have associated **labels**.
- [X ] My **Lighthouse Accessibility** score is **100**.
- [ X] I require a **valid name**. I have defined a valid name as a text string of two characters or more.
- [ X] I require a **valid email**.
- [X ] I require one **colour** from a defined set of 3 colours.
- [ X] I require one **size** from a defined set of 6 sizes.
- [ X] I require one **date** from a constrained date range.

### CSS
- [ X] I show which element is **focused**.
- [ X] My **Lighthouse Accessibility** score is **100**.
47 changes: 44 additions & 3 deletions Form-Controls/index.html

Choose a reason for hiding this comment

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

Hi @Mgphone ,
Fantastic work here with the form.

Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,66 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>My form exercise</title>
<title>T-Shirt Order Form</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header>
<h1>Product Pick</h1>
<h1>T-Shirt Order Form</h1>
</header>
<main>
<form>
<!-- write your html here-->
<!-- try writing out the requirements first-->
<h2>T-Shirt Order Form</h2>

<!-- Customer's Name -->
<label for="name">Full Name:</label>
<input type="text" id="name" name="name" required pattern="[A-Za-z\s]{2,}" title="Name should be at least 2 characters." class="input-field">

<!-- Customer's Email -->
<label for="email">Email:</label>
<input type="email" id="email" name="email" required class="input-field">

<!-- T-Shirt Colour -->
<label for="colour">T-Shirt Colour:</label>
<select id="colour" name="colour" required class="input-field">
<option value="">-- Select Colour --</option>
<option value="red">Red</option>
<option value="blue">Blue</option>
<option value="green">Green</option>
</select>

<!-- T-Shirt Size -->
<label for="size">T-Shirt Size:</label>
<select id="size" name="size" required class="input-field">
<option value="">-- Select 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>

<!-- Delivery Date -->
<label for="delivery">Delivery Date:</label>
<input type="date" id="delivery" name="delivery" required min="" max="" class="input-field">

<!-- Submit Button -->
<div class="button-order">
<input type="submit" value="Submit Order">

</div>

</form>

</main>
<footer>
<!-- change to your name-->
<h2>By HOMEWORK SOLUTION</h2>
<h2>Phone Myint Naing</h2>
</footer>
</body>

Expand Down
56 changes: 56 additions & 0 deletions Form-Controls/styles.css

Choose a reason for hiding this comment

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

Hi @Mgphone ,
May I suggest that you use rem instead of px for other css properties. It is advisable to use px for elements with fixed size (for example, border, and box-shadow).

Thanks

Copy link
Author

Choose a reason for hiding this comment

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

Hi @mrvicthor
I have just changed all to rem :)

Thanks.

Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
html {
font-size: 16px;
}
header h1 {
width: 100vw;
display: flex;
justify-content: center;
}
form {
display: flex;
flex-direction: column;
background: #fff;
padding: 2rem;
border-radius: 0.6rem;
max-width: 50rem;
margin: 0 auto;
box-shadow: 0 0 rgba(0, 0, 0, 0.1);
gap: 1rem;
}
h2 {
text-align: center;
}

label {
margin-top: 1rem;
font-weight: bold;
}

input,
select {
padding: 1rem;
margin-top: 0.5rem;
border-radius: 0.5rem;
border: 0.1rem solid #ccc;
}
.button-order {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
input[type="submit"] {
background-color: #1e7e34;
color: white;
cursor: pointer;
border: none;
/* margin-top: 20px;
width:20vw; */
}

input[type="submit"]:hover {
background-color: #218838;
}
input[type="submit"]:focus {
outline: 0.2rem solid black;
}