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 #793

Open
wants to merge 2 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
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://ollavka.github.io/layout_html-form/)
- [TEST REPORT LINK](https://ollavka.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
189 changes: 188 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,194 @@
<link rel="stylesheet" href="./style.css">
</head>
<body>
<h1>HTML Form</h1>
<header></header>
<main>
<form
class="form"
action="https://mate-academy-form-lesson.herokuapp.com/create-application"
method="post"
>
<fieldset class="form__fieldset form-fieldset">
<legend class="form-fieldset__title">Personal information</legend>
<div class="form-fieldset__field">
<label>
Surname:
<input
type="text"
name="lastname"
autocomplete="off"
required
>
</label>
</div>
<div class="form-fieldset__field">
<label>
Name:
<input
type="text"
name="firstname"
autocomplete="off"
required
>
</label>
</div>
<div class="form-fieldset__field">
<label>
How old are You?
<input
type="number"
name="age"
min="1"
max="100"
value="12"
required
>
</label>
</div>
<div class="form-fieldset__field">
<label>
Full date of birth:
<input
type="date"
name="birthDate"
required
>
</label>
</div>
<div class="form-fieldset__field">
<label>
I accept the term of the agreement
<input
type="checkbox"
name="term"
required
>
</label>
</div>
</fieldset>
<fieldset class="form__fieldset form-fieldset">
<legend class="form-fieldset__title">Registration</legend>
<div class="form-fieldset__field">
<label>
E-mail:
<input
type="email"
autocomplete="off"
placeholder="[email protected]"
name="email"
required
>
</label>
</div>
<div class="form-fieldset__field">
<label>
Password:
<input
type="password"
autocomplete="off"
name="password"
required
>
</label>
</div>
</fieldset>
<fieldset class="form__fieldset form-fieldset">
<legend class="form-fieldset__title">An interesting fact about you!</legend>
<div class="form-fieldset__field">
Do you love cats?
<label>
<input
type="radio"
name="isLoveCats"
value="true"
required
>
Yes
</label>
<label>
<input
type="radio"
name="isLoveCats"
value="false"
required
>
No
</label>
</div>
<div class="form-fieldset__field">
<label>
What is your favorite color?
<input
type="color"
name="color"
required
>
</label>
</div>
<div class="form-fieldset__field">
<label>
What time do you go to bed?
<input
type="time"
name="sleepTime"
step="1"
required
>
</label>
</div>
<div class="form-fieldset__field">
<label>
What are you favorite brand of cars?
<select name="favoriteCarBrand" multiple>
<option value="bmw">BMW</option>
<option value="audi">Audi</option>
<option value="lada">Lada</option>
</select>
</label>
</div>
<div class="form-fieldset__field">
<label>
How do you rate our work?
<input
type="range"
name="workRate"
min="1"
max="10"
step="1"
value="1"
>
</label>
</div>
</fieldset>
<fieldset class="form__fieldset form-fieldset">
<legend class="form-fieldset__title">Additional info</legend>
<div class="form-fieldset__field">
<label>
Comments:
<textarea
name="comments"
minlength="1"
autocomplete="off"
maxlength="100"
>
</textarea>
</label>
</div>
<div class="form-fieldset__field">
<label>
Would you recommend us?
<select name="isRecommend">
<option value="true">yes</option>
<option value="false">no</option>
</select>
</label>
</div>
</fieldset>
<button type="submit">Submit</button>
</form>
</main>
<footer></footer>

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

.form-fieldset__field:not(:last-child) {
margin-bottom: 10px;
}