Chapter 25: User Input with Forms
Learning Objectives
Upon completing all the content in this chapter, you should be able to do the following:
- Create a form using HTML
- Understand the main form element attributes, action and method
- Properly use common inputs: text, submit, radio, checkbox, select, textarea, password, email
- Use label elements to add human-readable labels to form inputs
- Use the name attribute to identify inputs in the submitted data
- Understand and describe form submission
- Use event handlers to validate form data
- 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.
Forms
- form
- input
- self-closing
- label
- focus
Form Submission
- form submission
POST Form Submission
- form handlers
Validation with JavaScript
- preventDefault