Chapter 25: User Input with Forms

Learning Objectives

Upon completing all the content in this chapter, you should be able to do the following:

  1. Create a form using HTML
  2. Understand the main form element attributes, action and method
  3. Properly use common inputs: text, submit, radio, checkbox, select, textarea, password, email
  4. Use label elements to add human-readable labels to form inputs
  5. Use the name attribute to identify inputs in the submitted data
  6. Understand and describe form submission
  7. Use event handlers to validate form data
  8. Know how to cancel form submission using event.preventDefault()

Key Terminology

Here is a list of key terms for this chapter, broken down by the page the term first appears on. As you read along, make note of these terms and their definitions.


  1. form
  2. input
  3. self-closing
  4. label
  5. focus

Form Submission

  1. form submission

POST Form Submission

  1. form handlers

Validation with JavaScript

  1. preventDefault

Chapter Content