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 Submission

Our form has several inputs now. The last thing it's missing is a way to send it.

We send a form with a button: the button element with the attribute type="submit". The content of the button element is the text on the button.

<button type="submit">Send</button>

This code is displayed like this:

When the user clicks the button, the browser sends the form data to the address in the form's action attribute. We don't have a server to process the data here, so the preview shows the page exercise.html instead. You can find it in the editor.

You may also come across another way of creating the same button: an input with type="submit", whose text is set by the value attribute:

<input type="submit" value="Send">

The button element is used more often, because its content can be more than plain text.

Instructions

  1. 1

    At the end of the form, create a button element with the attribute type="submit" and the content Submit. Then run the code, fill in the form and click the button.

Back

9/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.