Forms and user input
How websites collect information: building forms that are sent correctly, choosing the right control for each answer, and checking values before they are sent.
About 4 hours of study
Learning objectives
- Build a form that sends the right data
- Pick suitable controls
- Add rules with HTML alone
Lessons
- 1
Forms: asking the user for information
Build a form that really sends data: inputs, labels, names, buttons, GET and POST, and why every field needs a label.
- 2
The right control for each question
Number boxes, dates, checkboxes, radio buttons, drop-downs and text areas: choose the control that suits the answer, and group related ones.
- 3
Checking answers before they are sent Intermediate
Use the browser's built-in checks: required, length and range limits, patterns, and why a check in the browser never replaces one on the server.
Module practice
- A newsletter formEasy
- A search form with a filterMedium
- Find everything wrong with a sign-up formHard
- Choose the input typesEasy
- A question with one answerMedium
- A complete order formHard
- Make the fields requiredEasy
- Only accept a valid codeMedium
- A booking form with real rulesHard
Module quiz
‹ Links, images, lists and tablesMeaningful, accessible pages ›