Skip to content
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
140 changes: 139 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,145 @@
<link rel="stylesheet" href="./style.css">
</head>
<body>
<h1>HTML Form</h1>
<script type="text/javascript" src="./main.js"></script>
<form
action="https://mate-academy-form-lesson.herokuapp.com/create-application"
method="post"
>
Comment on lines +15 to +18
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
<form
action="https://mate-academy-form-lesson.herokuapp.com/create-application"
method="post"
>
<form
action="https://mate-academy-form-lesson.herokuapp.com/create-application"
method="post"
>

<fieldset class="field">
<legend>Personal information</legend>
<label class="form">
Surname:
<input
type="text"
name="surname"
autocomplete="off"
>
</label>
<label class="form">
Comment on lines +28 to +30
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Don't forget to add empty lines between multiline sibling blocks of HTML. Fix it everywhere

Suggested change
</label>
<label class="form">
</label>
<label class="form">

Name:
<input
type="text"
name="name"
autocomplete="off"
>
</label>
<label class="form">
How old are you?
<input
type="number"
name="age"
value="12"
min="1"
max="100"
>
</label>
<label class="form">
Full date of birth:
<input type="date" name="date">
</label>
<div class="form">
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This div seems redundant. Just wrap the input into the label as you did it above

<label for="termsOfAgreement">
I accept the terms of the agreement
</label>
<input
type="checkbox"
name="terms"
id="termsOfAgreement"
required
>
</div>
</fieldset>
<fieldset class="field">
<legend>Registration</legend>
<label class="form">
E-mail:
<input
type="email"
name="email"
placeholder="email@example.com"
>
</label>
<label class="form">
Password
<input
type="password"
name="password"
minlength="5"
maxlength="10"
>
</label>
</fieldset>
<fieldset class="field">
<legend>An interesting fact about you!</legend>
<label class="form">
Do you love cats?
<label>
<input
type="radio"
name="catLover"
value="yes"
>
Yes
</label>
<label>
<input
type="radio"
name="catLover"
value="no"
>
Comment on lines +96 to +105
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Check the code style here

Suggested change
<input
type="radio"
name="catLover"
value="no"
>
<input
type="radio"
name="catLover"
value="no"
>

No
</label>
</label>
<label class="form">
What is your favorite color?
<input type="color" name="color">
</label>
<label class="form">
What time do you go to bed?
<input
type="time"
name="bedtime"
step="2"
>
</label>
<label class="form">
What are your favourite car brands?
<select name="carBrans" multiple >
<option value="BMW">BMW</option>
<option value="Audi">Audi</option>
<option value="Lada">Lada</option>
</select>
</label>
<label class="form">
How do you rate our work?
<input
type="range"
name="rateOurWork"
min="0"
max="10"
>
</label>
</fieldset>
<fieldset class="field">
<legend>Additional info:</legend>
<label class="form">
Comments:
<textarea
name="feedback"
rows="2"
cols="20"
></textarea>
</label>
<label class="form">
Would you recommend us?
Comment on lines +154 to +155
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
<label class="form">
Would you recommend us?
<label class="form">
Would you recommend us?

<select name="recommend" required >
<option value="yes" selected >Yes</option>
<option value="no">No</option>
</select>
</label>
</fieldset>
<button type="submit">Submit</button>
</form>
</body>
</html>
14 changes: 13 additions & 1 deletion src/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
/* styles go here */
.field {
display: block;
margin-bottom: 20px;
}

.form {
display: block;
margin-bottom: 10px;
}

.form:last-child {
margin-bottom: 0;
}