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

add task solution #804

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
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
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://TheOldDream.github.io/layout_html-form/)
- [TEST REPORT LINK](https://TheOldDream.github.io/layout_html-form/report/html_report/)

> 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
185 changes: 184 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,190 @@
<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">
<fieldset class="personalInformation firstSection">
<legend>Personal information</legend>
<label class="form_field firstInput">
Surname:
<input
name="Surname"
type="text"
autocomplete="off"
required
minlength="5"
maxlength="35"
>
</label>

<label class="form_field">
Name:
<input
name="Name"
type="text"
autocomplete="off"
required
minlength="5"
maxlength="25"
>
Comment on lines +32 to +39

Choose a reason for hiding this comment

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

Suggested change
<input
name="Name"
type="text"
autocomplete="off"
required
minlength="5"
maxlength="25"
>
<input
name="Name"
type="text"
autocomplete="off"
required
minlength="5"
maxlength="25"
>

</label>

<label class="form_field">
How old are You?
<input
name="Age"
id="Age"
type="number"
required
min="1"
max="100"
value="12"
>
</label>

<label class="form_field">
Full date of birth:
<input
name="submissionDate"
type="date"
required
>
</label>

<label class="form_field lastInput">
I accept the term of the agreement
<input
type="checkbox"
name="Terms"
id="terms"
required
>
</label>
</fieldset>


<fieldset class="registration">
<legend>Registration</legend>
<label class="form_field firstInput">
E-mail:
<input
name="Email"
type="email"
required
minlength="10"
maxlength="35"
placeholder="[email protected]"
>
</label>

<label class="form_field lastInput">
Password:
<input
name="Password"
type="password"
required
minlength="5"
maxlength="25"
>
</label>
</fieldset>

<fieldset class="aifay">
<legend>An interesting fact about you!</legend>
Do you love cats?
<label
for="Yes"
class="form_field firstInput eighthInput-1"
>
<input
name="Answer"
type="radio"
value="Answer"
id="Yes"
>
Yes
</label>

<label
for="No"
class="form_field firstInput eighthInput-2"
Comment on lines +119 to +120

Choose a reason for hiding this comment

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

Suggested change
for="No"
class="form_field firstInput eighthInput-2"
for="No"
class="form_field firstInput eighthInput-2"

>
<input
name="Answer"
type="radio"
value="Answer"
id="No"
>
No
</label>

<label class="form_field">
What is your favorite color?
<input
name="color"
type="color"
required
>
</label>

<label class="form_field">
What time do you go to bed?
<input
name="time"
type="time"
required
step="1"
>
</label>

<label class="form_field">
What are your favorite brand of cars?
<select multiple name="selection">
<option value="Bmw" multiple>BMW</option>
<option value="Audi" multiple>Audi</option>
<option value="Lada" multiple>Lada</option>
</select>
</label>

<label class="form_field lastInput">
How do you rate our work?
<input
type="range"
name="rating"
value="0"
>
</label>
</fieldset>

<fieldset class="additionalInformation fourthSection">
<legend>Additional info:</legend>
<label class="form_field firstInput">
Comments:
<textarea
name="comment"
rows="2"
cols="20"
autocomplete="off"
></textarea>
</label>

<label class="form_field lastInput">
Would you reccomend us?
<select name="select">
<option value="select" disabled>Please select an option</option>
<option value="Yes">Yes</option>
<option value="No">No</option>
</select>
</label>
</fieldset>

<button
class="button"
type="submit"
name="submit"
>
Submit
</button>
</form>
</body>
</html>
48 changes: 48 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,49 @@
/* styles go here */
.form_field {
display: block;
margin-bottom: 10px;
}

.personalInformation {
margin-top: 15px;
margin-bottom: 15px;
}

.registration {
margin-top: 20px;
margin-bottom: 15px;
}

.aifay {
margin-top: 20px;
margin-bottom: 15px;
}

.additionalInformation {
margin-top: 20px;
margin-bottom: 15px;
}

.firstSection {
margin-top: 0;
}

.fourthSection {
margin-bottom: 0;
}

.firstInput {
margin-top: 0;
}

.lastInput {
margin-bottom: 0;
}

.eighthInput-1 {
display: inline-block;
}

.eighthInput-2 {
display: inline-block;
}