Skip to content
Open
Show file tree
Hide file tree
Changes from 9 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://Kacper-Leman.github.io/layout_html-form/)
- [TEST REPORT LINK](https://Kacper-Leman.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@example.com`.
- 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
206 changes: 205 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,211 @@
<link rel="stylesheet" href="./style.css">
</head>
<body>
<h1>HTML Form</h1>
<form action="https://mate-academy-form-lesson.herokuapp.com/create-application">
<fieldset class="fieldset">
<legend>Personal information</legend>

<div class="form-field">
<label for="surname">Surnmae: </label>

<input
type="text"
name="surname"
id="surname"
autocomplete="off"
>
</div>

<div class="form-field">
<label for="name">Name: </label>

<input
type="text"
name="name"
id="name"
autocomplete="off"
>
</div>

<div class="form-field">
<label for="age">How old are You?</label>

<input
type="number"
name="age"
id="age"
autocomplete="off"
value="12"
min="1"
max="100"
required
>
</div>

<div class="form-field">
<label for="date-birth">Full date of birth: </label>

<input
type="date"
name="dateBirth"
id="date-birth"
autocomplete="off"
>
</div>

<div>

Choose a reason for hiding this comment

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

In my opinion best way is to add form-field class to all divs and in css you can remove margin-bottom in :last-child selector. This is more consistant. It is a separation of duites, that styles will determin how the markup looks.

<label for="agreement">I accept the term of the agreement </label>

<input
type="checkbox"
name="agreement"
id="agreement"
autocomplete="off"
required
>
</div>
</fieldset>

<fieldset class="fieldset">
<legend>Registration</legend>

<div class="form-field">
<label for="email">E-mail: </label>

<input
type="email"
name="email"
id="email"
autocomplete="off"
placeholder="email@example.com"
required
>
</div>

<div>
<label for="password">Password: </label>

<input
type="password"
name="password"
id="password"
autocomplete="off"
required
minlength="5"
maxlength="10"
>
</div>
</fieldset>

<fieldset class="fieldset">
<legend>An interesting fact about you!</legend>

<div class="form-field">
<label for="yes">Do you love cats?</label>

<input
type="radio"
name="lovesCats"
id="yes"
autocomplete="off"
value="Yes"
>

<label for="yes">Yes</label>

<input type="radio"
name="lovesCats"
id="no"
autocomplete="off"
value="No"
>

Choose a reason for hiding this comment

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

Fix formatting

Suggested change
<input type="radio"
name="lovesCats"
id="no"
autocomplete="off"
value="No"
>
<input
type="radio"
name="lovesCats"
id="no"
autocomplete="off"
value="No"
>


<label for="no">No</label>
</div>

<div class="form-field">
<label for="colour">What is your favorite color?</label>

<input
type="color"
name="colour"

Choose a reason for hiding this comment

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

fix typo

Choose a reason for hiding this comment

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

Should be

Suggested change
name="colour"
name="color"

id="colour"
autocomplete="off"
>
</div>

<div class="form-field">
<label for="time">What time do you go to bed?</label>

<input
type="time"
name="time"
id="time"
autocomplete="off"
>
</div>

<div class="form-field">
<label for="cars">What are your favorite brand of cars?</label>

<select
name="cars"
id="cars"
autocomplete="off"
multiple
>

Choose a reason for hiding this comment

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

Remove line between parent and child tag

Choose a reason for hiding this comment

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

Remove space

<option value="BMW">BMW</option>
<option value="Audi">Audi</option>
<option value="Lada">Lada</option>
</select>
</div>

<div>
<label for="rating">How do you rate our work?</label>

<input
type="range"
name="rating"
id="rating"
value="0"
autocomplete="off"
>
</div>
</fieldset>

<fieldset class="fieldset">
<legend>Additional info:</legend>

<div class="form-field">
<label for="comment">Comments: </label>

<textarea
name="comment"
id="comment"
cols="20"
rows="2"
autocomplete="off"
></textarea>
</div>

<div>
<label for="recommend">Would you recommend us?</label>

<select
name="recommend"
id="recommend"
autocomplete="off"
>

Choose a reason for hiding this comment

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

remove space

<option value="Yes">yes</option>
<option value="no">no</option>
</select>
</div>
</fieldset>

<button type="submit">Submit</button>
</form>
<script type="text/javascript" src="./main.js"></script>
</body>
</html>
9 changes: 8 additions & 1 deletion src/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
/* styles go here */

.form-field {
margin-bottom: 10px;
}

.fieldset {
margin-bottom: 20px;
}