How Forms Work
A form is how a page asks a question and sends the answer somewhere. You will see exactly what a form sends, the difference between GET and POST, and build text boxes with labels and buttons that do what you expect.
Updated
Forms and Their Data
- How a Form Sends Data (Apprentice): A form turns each answer into a name=value pair and sends the pairs to the address in its action, inside the address itself with GET or inside the request with POST.
Inputs, Labels and Buttons
- Text Inputs and Labels (Apprentice): A text input is a one-line box with a name for the data it sends, and a label tied to it by for and id tells everyone, screen readers included, what the box is for.
- Buttons (Apprentice): A button's type decides what it does in a form, submit, reset or nothing at all, and a button with no type sends the form, which surprises people.
Exercise: A Song Request Form
- Exercise: A Song Request Form (Apprentice): Build the request form for a local radio station, with four labeled text boxes and a submit button, then send it by GET and by POST and record exactly what it sent, while the tests check every box and label.