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

Open
wants to merge 1 commit 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://<MaciejKujawa.github.io/layout_html-form/)
- [TEST REPORT LINK](https://MaciejKujawa.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
166 changes: 164 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!doctype html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
Expand All @@ -11,7 +11,169 @@
<link rel="stylesheet" href="./style.css">
</head>
<body>
<h1>HTML Form</h1>
<form
id="form"
method="post"
action="https://mate-academy-form-lesson.herokuapp.com/create-application">
<fieldset class="fieldset">
<legend>Personal information</legend>
<div class="form">
<label>Surname:
<input
type="text"
name="surname"
autocomplete="off"
required
>
</label>
</div>

<div class="form">
<label>Name:
<input
type="text"
name="name"
autocomplete="off"
required
>
</label>
</div>

<div class="form">
<label>How old are You?
<input
type="number"
min="1"
max="100"
value="12"
name="age"
required
>
</label>
</div>

<div class="form">
<label>Full date of birth:
<input
type="date"
name="birthday"
required
>
</label>
</div>

<div class="form">
<label>I accept the terms of the agreements
<input
type="checkbox"
name="agree"
required
>
</label>
</div>
</fieldset>
<fieldset class="fieldset">
<legend>Registration</legend>
<div class="form">
<label>E-mail:
<input
type="email"
placeholder="[email protected]"
name="email"
required
>
</label>
</div>

<div class="form">
<label>Password
<input
type="password"
name="password"
minlength="3"
maxlength="8"
required
>
</label>
</div>
</fieldset>
<fieldset class="fieldset">
<legend>An interesting fact about you!</legend>
<div class="form">
<label>Do you love cats?
<input
type="radio"
name="love-cats"
value="yes"
>Yes
</label>
<label>
<input
type="radio"
name="love-cats"
value="no"
>No
</label>
</div>

<div class="form">
<label>What is your favorite color?
<input type="color">
</label>
</div>

<div class="form">
<label>What time do you go to bed?
<input type="time">
</label>
</div>

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

<div class="form">
<label
>How do you rate our work?
<input
type="range"
min="0"
max="10"
step="1"
value="0"
>
</label>
</div>
</fieldset>
<fieldset class="fieldset">
<legend>Additional info:</legend>
<div class="form">
<label>Comments:
<textarea
name="comments"
cols="18"
rows="2"
></textarea>
</label>
</div>

<div class="form">
<label>Would you recommend us?
<select name="recommendation">
<option value="yes" selected>yes</option>
<option value="no">no</option>
</select>
</label>
</div>
</fieldset>
</form>
<button type="submit" form="form">Submit</button>
<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 */
.fieldset {
margin-bottom: 20px;
}

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