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

solution #665

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from 5 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
48 changes: 47 additions & 1 deletion .linthtmlrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,49 @@
{
"extends": "@mate-academy/linthtml-config"
"attr-bans": [
"align",
"background",
"bgcolor",
"border",
"frameborder",
"style"
],
"attr-name-ignore-regex": "viewBox",
"attr-no-dup": true,
"attr-quote-style": "double",
"attr-req-value": true,
"class-no-dup": true,
"doctype-first": true,
"doctype-html5": true,
"fig-req-figcaption": true,
"head-req-title": true,
"html-req-lang": true,
"id-class-style": false,
"id-no-dup": true,
"img-req-src": true,
"img-req-alt": "allownull",
"indent-width": 2,
"indent-style": "spaces",
"indent-width-cont": true,
"input-radio-req-name": true,
"spec-char-escape": true,
"tag-bans": [
"b",
"i",
"u",
"center",
"style",
"marquee",
"font",
"s"
],
"tag-name-lowercase": true,
"tag-name-match": true,
"tag-self-close": "never",
"tag-close": true,
"text-ignore-regex": "&",
"title-no-dup": true,
"line-end-style": "lf",
"attr-new-line": 2,
"attr-name-style": "dash",
"attr-no-unsafe-char": true
}
6 changes: 3 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# HTML form
Replace `<your_account>` with your Github username and copy the links to Pull Request description:
- [DEMO LINK](https://<your_account>.github.io/layout_html-form/)
- [TEST REPORT LINK](https://<your_account>.github.io/layout_html-form/report/html_report/)
- [DEMO LINK](https://Taras0506.github.io/layout_html-form/)
- [TEST REPORT LINK](https://Taras0506.github.io/layout_html-form/report/html_report/).
etojeDenys marked this conversation as resolved.
Show resolved Hide resolved

> Follow [this instructions](https://mate-academy.github.io/layout_task-guideline/#how-to-solve-the-layout-tasks-on-github)
___
Expand Down Expand Up @@ -40,7 +40,7 @@ Create HTML page with form. On form submit send form data to `https://mate-acade
- Age should be at least `1` and at max `100` with a default value of `12`
- The email field should have placeholder value: `[email protected]`.
- Text fields should have `autocomplete="off"`.
- `Submit` button should have a `type="submit"`
- `Submit` button should have a `type="submit"`
- Vertical distance between inputs should be `10px`
- Vertical distance between groups should be `20px`
- Any other styles should be browser default
Expand Down
165 changes: 163 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,173 @@
name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
>
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta
http-equiv="X-UA-Compatible"
content="ie=edge"
>
<title>HTML Form</title>
<link rel="stylesheet" href="./style.css">
</head>
<body>
<h1>HTML Form</h1>
<script type="text/javascript" src="./main.js"></script>
<form
action="https://mate-academy-form-lesson.herokuapp.com/create-application"
method="post"
autocomplete="off"
>
<fieldset>
<legend>Personal information</legend>
<label class="form-field">
Surname:
<input
name="feedback"

Choose a reason for hiding this comment

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

The 'name' attribute should be unique for each input field. Please change the 'name' attribute for the Surname input field to something like 'surname'.

Choose a reason for hiding this comment

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

image

fix it everywhere

>
</label>

<label class="form-field">
Name:
<input
name="feedback"
>
</label>

<label class="form-field">
How old are You?
<input
Comment on lines +39 to +41

Choose a reason for hiding this comment

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

Suggested change
<label class="form-field">
How old are You?
<input
<label class="form-field">
How old are You?
<input

check and fix other places of wrong indentation

Choose a reason for hiding this comment

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

still not fixed

type="number"
name="age"
value="12"
>
</label>

<label class="form-field">
Full date of birth:
<input
name="feedback"
placeholder="mm/dd/yyyy"
type="date"
>
</label>

<label class="form-field">
I accept the term of the agreement
<input
type="checkbox"
name="terms"
id="terms-and-conditions"
required
>
</label>
</fieldset>

<fieldset>
<legend>Registration</legend>
<div class="form_field">
Email:
<input
type="email"
name="email"
placeholder="[email protected]"
>
</div>

<div class="form-field">
Password:
<input
type="password"
name="password"
required
minlength="5"
maxlength="32"
>
</div>
</fieldset>

<fieldset>
<legend>An interesting fact about you!</legend>
<div class="form-field">
Do you love cats?
<label>
<input
type="radio"
name="sex"
value="f"
>
Yes
</label>

<label>
<input
type="radio"
name="sex"
value="m"
>
No
</label>
</div>
<label class="form-field">
What is your favorite color?
<input
type="color"
id="head"
name="head"
value="black"
>
</label>

<label class="form-field">
What time do you go to bed?
<input
Comment on lines +123 to +125

Choose a reason for hiding this comment

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

Suggested change
<label class="form-field">
What time do you go to bed?
<input
<label class="form-field">
What time do you go to bed?
<input

still not fixed in all similar places

type="time"
id="appt"
name="appt"
value="--:--:--"
>
</label>
<div class="form_field">

Choose a reason for hiding this comment

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

Suggested change
<div class="form_field">
<div class="form-field">

What are your favorite brand of cars?
<select name="text">

Choose a reason for hiding this comment

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

The 'name' attribute for the favorite brand of cars select input should be 'brand' or a more descriptive name instead of 'text'

<option selected>BMW</option>
<option selected>Audi</option>
<option>Lada</option>
<option>Other</option>
</select>
</div>
<label for="start">

Choose a reason for hiding this comment

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

Suggested change
<label for="start">
<label for="rate">

for and id in input should be the same

How do you rate your work?
<input
type="range"
id="rate"
min="0"
>

Choose a reason for hiding this comment

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

The 'name' attribute is missing for the How do you rate your work range input

</label>
</fieldset>

<fieldset>
<legend>Additional info:</legend>
<label class="form-field">
Comments:
<textarea
name="feedback"
rows="2"
cols="20"
></textarea>
</label>

<label class="form-field">
Would you recommened us?
<select name="select">
<option>Yes</option>
<option>No</option>
</select>
</label>
</fieldset>
<button type="submit">Submit</button>
</form>
</body>
</html>





16 changes: 16 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
/* styles go here */
.form-field {
display: block;
margin: 10px 0;
}

.field:invalid {
border: 1px solid red;
}

.field:focus {
background-color: azure;
}

.field:checked ~ .form__label {
color: grey;
}

Choose a reason for hiding this comment

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

Suggested change
.field:invalid {
border: 1px solid red;
}
.field:focus {
background-color: azure;
}
.field:checked ~ .form__label {
color: grey;
}

looks like redundant styles for this task