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

Added task solution #782

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
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://kyrylomanko.github.io/layout_html-form/)
- [TEST REPORT LINK](https://kyrylomanko.github.io/layout_html-form/report/html_report/)
Comment on lines +3 to +4

Choose a reason for hiding this comment

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

You should add these links to the PR description


> 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
143 changes: 142 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,148 @@
<link rel="stylesheet" href="./style.css">
</head>
<body>
<h1>HTML Form</h1>
<form action="https://mate-academy-form-lesson.herokuapp.com/create-application" method="post">
<fieldset>
<legend>Personal information</legend>
<label for="surname">Surname:</label>
<input
cletype="text"
class="distance"

Choose a reason for hiding this comment

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

Use more meaningful class names. For example:

Suggested change
class="distance"
class="form-field"

id="surname"
name="surname"
autocomplete="off"
><br>

Choose a reason for hiding this comment

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

Why do you need these br tags everywhere? Remove them

Suggested change
><br>
>


<label for="name">Name:</label>
<input
type="text"
class="distance"
id="name"
name="name"
autocomplete="off"
><br>

<label for="age">How old are You?</label>
<input
type="number"
class="distance"
id="age"
name="age"
min="1"
max="100"
value="12"
><br>

<label for="birth">Full date of birth:</label>
<input
type="date"
class="distance"
id="birth"
name="birth"
><br>

<label for="checkbox">I accept the term of the agreement</label>
<input
type="checkbox"
id="checkbox"
name="checkbox"
>

</fieldset>

Choose a reason for hiding this comment

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

Suggested change
>
</fieldset>
>
</fieldset>


<fieldset>
<legend>Registration</legend>
<label for="email">E-mail:</label>
<input
type="email"
class="distance"
id="email"
name="email"
placeholder="[email protected]"
><br>

<label for="password">Password:</label>
<input
type="password"
id="password"
name="password"
>

</fieldset>

Choose a reason for hiding this comment

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

Don't add spaces between parent and child elements

Suggested change
>
</fieldset>
>
</fieldset>


<fieldset>
<legend>An interesting fact about you!</legend>
<div class="distance">
<label for="cat">
Do you love cats?
<input type="radio" name="Yes">
Yes
<input type="radio" name="No">
No
</label>
</div>
<label for="color">What is your favorite color?</label>
<input
type="color"
class="distance"
id="color"
name="color"
><br>

<label for="time">What time do you go to bed?</label>
<input
type="time"
step="1"
class="distance"
id="time"
name="time"
><br>

<div class="distance">
<label for="car">What are your favorite brand of cars?</label>
<select
name="car"
id="car"
multiple
>
<option value="BMW">BMW</option>
<option value="Audi">Audi</option>
<option value="Lada">Lada</option>
</select>
</div>

<label for="rate">How do you rate our work?</label>
<input
type="range"
value="0"
name="rate"
id="rate"
>
</fieldset>

<fieldset>
<legend>Additional info:</legend>
<div class="distance">
<label for="cm">Comments:</label>
<textarea autocomplete="off"></textarea>
</div>

<div>
<label for="rec">Would you recommend us?</label>
<select name="rec" id="rec">
<option value="yes">Yes</option>
<option value="no">No</option>
</select>
</div>

</fieldset>

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

</form>
<script type="text/javascript" src="./main.js"></script>
</body>
</html>
7 changes: 7 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
/* styles go here */
.distance {
margin-bottom: 10px;
}

fieldset {

Choose a reason for hiding this comment

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

Don't style tags, use class selector instead

margin-bottom: 20px;
}