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

Open
wants to merge 3 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://Luk2asz.github.io/layout_html-form/)
- [TEST REPORT LINK](https://Luk2asz.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
208 changes: 205 additions & 3 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,214 @@
name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
>
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta
http-equiv="X-UA-Compatible"
content="ie=edge"
>
<title>HTML Form</title>
<link rel="stylesheet" href="./style.css">
<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 class ="chapter-wrapper">
<legend>Personal information</legend>

<div class="field-wrapper">
<label for="surname">Surname:</label>

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

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

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

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

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

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

<input
type="date"
name="date"
id="date"
>
</div>

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

<input type="checkbox"
name="agree"
id="agree"
required
>
</div>
</fieldset>

<fieldset class ="chapter-wrapper">
<legend>Registration</legend>

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

<input
type="email"
name="email"
id="email"
placeholder="[email protected]"
>
</div>

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

<input
type="password"
name="password"
id="password"
minlength="6"
maxlength="20"
>
</div>

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

<div class="field-wrapper">
Do you love cats?
<input
type="radio"
name="cats"
value="yes"
id="yes"
>

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

<input
type="radio"
name="cats"
value="no"
id="no"
>

<label for="no">Yes</label>
Copy link

Choose a reason for hiding this comment

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

The label text for the 'no' radio button should be 'No' instead of 'Yes'

</div>

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

<input type="color"
name="color"
id="color"
>
</div>

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

<input
type="time"
name="time"
id="time"
step="2"
>
</div>

<div class="field-wrapper">
<label for="select">What are you favorite brand of cars?</label>

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

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

<input
type="range"
name="range"
id="range"
min="0"
max="10"
value="5"
placeholder="5"
>
</div>
</fieldset>

<fieldset class ="chapter-wrapper">
<legend>Additional info</legend>

<div class="field-wrapper">
<label for="textarea">Comments:</label>

<textarea
name="textarea"
id="textarea"
></textarea>
</div>

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

<select
name="recommend"
id="recommend"
>
<option value="yes">yes</option>
<option value="no">no</option>
</select>
</div>
</fieldset>

<div class="field-wrapper">
<input
type="submit"
value="Submit"
>
</div>

</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 */
.field-wrapper {
margin-bottom: 10px;
}

.chapter-wrapper {
Copy link

Choose a reason for hiding this comment

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

I would suggest here to give a more descriptive name for this class, maybe something like .fieldset-wrapper or .form-section :)

margin-bottom: 20px;
}