-
Notifications
You must be signed in to change notification settings - Fork 609
html-form #798
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
base: master
Are you sure you want to change the base?
html-form #798
Changes from 1 commit
22d3147
507605a
74e2d31
72c24ef
8c89f09
32231db
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,148 @@ | |
| <link rel="stylesheet" href="./style.css"> | ||
| </head> | ||
| <body> | ||
| <h1>HTML Form</h1> | ||
| <script type="text/javascript" src="./main.js"></script> | ||
| <form action="http://localhost:8080/api" method="post" | ||
| class="form"> | ||
| <fieldset class="form__group"> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Generally you don't have any empty lines between elements making this code very hard to read, for example you should always have empty line between siblings: <div>
<span>first child</span>
<p>second child</p>
</div>there is an exception to this rule, for example when you have a bunch of similar elements like in ul <ul>
<li>text</li>
<li>text</li>
<li>text</li>
<li>text</li>
</ul> |
||
| <legend>Personal information</legend> | ||
| <div class="form-field"> | ||
| Surname: | ||
| <input | ||
| type="text" | ||
| autocomplete="off" | ||
| > | ||
| </div> | ||
| <div class="form-field"> | ||
| Name: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Such text should be a label for appropriate input so upon clicking on it correct field is focused |
||
| <input | ||
| type="text" | ||
| autocomplete="off" | ||
| > | ||
| </div> | ||
| <div class="form-field"> | ||
| How old are You? | ||
| <input | ||
| type="number" | ||
| name="number" | ||
| min="1" max="100" | ||
| value="12" | ||
| > | ||
| </div> | ||
| <div class="form-field"> | ||
| Full date of birth: | ||
| <input | ||
| type="date" | ||
| name="date" | ||
| > | ||
| </div> | ||
| <div> | ||
| I accept the term of the agreement | ||
| <input | ||
| type="checkbox" | ||
| name="agreement" | ||
| required | ||
| > | ||
| </div> | ||
| </fieldset> | ||
| <fieldset class="form__group"> | ||
| <legend>Registration</legend> | ||
| <div class="form-field"> | ||
| E-mail: | ||
| <input | ||
| type="email" | ||
| name="email" | ||
| placeholder="email@example.com" | ||
| > | ||
| </div> | ||
| <div> | ||
|
||
| Password: | ||
| <input | ||
| type="password" | ||
| name="password" | ||
| autocomplete="off" | ||
| required minlength="5" | ||
| maxlength="15" | ||
| > | ||
| </div> | ||
| </fieldset> | ||
| <fieldset class="form__group"> | ||
| <legend>An interesting fact about you!</legend> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As stated in the previous review all siblings should have an empty line between them apart from some specials situations with repeated tags: <fieldset class="form__group">
<legend>An interesting fact about you!</legend>
<div class="form__field">
<span>Do you love cats?</span>
<label for="love">Yes</label>
<input
type="radio"
id="love"
name="cats"
value="yes"
>
<label for="hate">No</label>
<input
type="radio"
id="hate"
name="cats"
value="no"
>
</div>There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also see that I have wrapped you |
||
| <div class="form-field"> | ||
| Do you love cats? | ||
| <input | ||
| type="radio" | ||
| id="love" | ||
| name="cats" | ||
| value="Yes" | ||
| > | ||
| <label for="love">Yes</label> | ||
| <input | ||
| type="radio" | ||
| id="hate" | ||
| name="cats" | ||
| value="No" | ||
| > | ||
| <label for="hate">No</label> | ||
| </div> | ||
| <div class="form-field"> | ||
| What is your favorite color? | ||
| <input | ||
| type="color" | ||
| name="color" | ||
| > | ||
| </div> | ||
| <div class="form-field"> | ||
| What time do you go to bed? | ||
| <input | ||
| type="time" | ||
| name="time" | ||
| > | ||
| </div> | ||
| <div class="form-field"> | ||
| <label for="brand-picker">What are your favorite brand of cars?</label> | ||
| <select id="brand-picker" name="cars" | ||
| required multiple> | ||
| <option value="BMW">BMW</option> | ||
| <option value="Audi">Audi</option> | ||
| <option value="Lada">Lada</option> | ||
| <option value=" " | ||
| disabled> | ||
| </option> | ||
| </select> | ||
| </div> | ||
| <div> | ||
| How do you rate our work? | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be a label for the below input |
||
| <input | ||
| type="range" | ||
| name="range" | ||
| min="1" | ||
| max="100" | ||
| > | ||
| </div> | ||
| </fieldset> | ||
| <fieldset class="form__group"> | ||
| <legend>Additional info:</legend> | ||
| <div class="form-field"> | ||
| Comments: | ||
| <textarea id="comments" name="comments"></textarea> | ||
| </div> | ||
| <div> | ||
| Would you recommend us? | ||
| <select name="recommend"> | ||
| <option value="recommend" | ||
| disabled> | ||
| </option> | ||
| <option value="yes" | ||
|
||
| selected>yes | ||
| </option> | ||
| <option value="no">no</option> | ||
| </select> | ||
| </div> | ||
| </fieldset> | ||
| <div class="form-submit"> | ||
|
||
| <button type="submit">Submit</button> | ||
| </div> | ||
| </form> | ||
| </body> | ||
| </html> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,9 @@ | ||
| /* styles go here */ | ||
|
|
||
| .form__group { | ||
| margin-bottom: 20px; | ||
| } | ||
|
|
||
| .form-field { | ||
| box-sizing: border-box; | ||
| margin-bottom: 10px; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
action according to requirements should be
https://mate-academy-form-lesson.herokuapp.com/create-applicationThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also formatting is wrong, adjust according to the checklist p. 4