Information about cookies on this page

Our website uses cookies to ensure the functionality of the website, to collect and analyze information about the performance and usage of the website. Privacy Policy

  • Courses
    • Discord
    • Twitter
    • Linkedin
    • Facebook
    • Instagram
  • Pricing
  • English
  • Čeština
  • Deutsch
  • Русский
Sign inStart free
  • Courses
  • Pricing

Community

Sign in
  
  • Courses
    • Discord
    • Twitter
    • Linkedin
    • Facebook
    • Instagram
  • Pricing
  • English
  • Čeština
  • Deutsch
  • Русский
Sign inStart free
  • Courses
  • Pricing

Community

Sign in

Form Summary

In this lesson, we learned how to build forms and found out that:

  • A form is created with the form element and its attributes:
    • action: the URL the data is sent to,
    • method: how the data is sent: GET in the address (for example for a search) or POST inside the request (for example for logging in).
  • Inputs are created with the input element and its attributes:
    • type: the type of the input, for example text, password, email, number, date, range, radio or checkbox,
    • name: the name that is sent together with the input's value, for example name=Tim,
    • id: a unique identifier, which connects the input to its label,
    • value: a pre-filled value, or for a radio button, the value sent when it's chosen.
  • Radio buttons with the same name form a group in which only one can be chosen. Checkboxes are independent of each other.
  • A drop-down list is created with the select element with option elements inside it, and a box for longer text with the textarea element.
  • Every input needs a label: the label element, whose for attribute has the same value as the id of its input. Clicking the label puts the cursor into the input, and screen readers read it aloud.
  • A form is sent with the button <button type="submit">Submit</button> (or <input type="submit" value="Submit">).
  • An input is made required with the required attribute.

In the next lesson, a final project awaits you, in which you'll use what you've learned in the whole course.

Instructions

  1. 1

    Congratulations on completing the lesson on forms! The editor contains your final code from this lesson. Now you can customize the form with your newly acquired knowledge, and then move on to the final project.

Back

11/11

  1. 1. The Form Element
  2. 2. Text Input
  3. 3. Input Label
  4. 4. Password Input
  5. 5. More Input Types
  6. 6. Radio Buttons and Checkboxes
  7. 7. Drop-down List
  8. 8. Longer Text
  9. 9. Form Submission
  10. 10. Required Input
  11. 11. Form Summary
Next

Try it yourself

Do this exercise right here in your browser. No account needed.