HTML forms
form, label, input and its types, validation attributes, and what the browser sends with GET or POST: knowing which fields are sent and how the request is written.
- 26 cards
- 5 topics
- Free
The outline, topic by topic
Each topic is weighted the way the exam weighs it.
- Concepts
- Questions
- Sort and link
- The numbers
- Scenarios
A few cards from the deck
A field's name attribute: what is it?
Show the answer
The key under which the field's value is sent to the server, in the key=value pair.
A field without
nameis not sent at all, even when filled in.nameis notid, which is used to link alabelor to target the field in CSS.A GET form with action
/searchcontains<input name="q">filled with "cat" and<select name="lang">set to "fr". Which URL does the browser request?/search?q=cat&lang=fr/search?q=cat;lang=fr/search?q=cat?lang=fr/search/cat/fr
Show the answer
/search?q=cat&lang=frA single
?opens the query string, then eachname=valuepair is separated from the next by&. Fields are sent in the order they appear in the form.The … attribute of
formgives the address that receives the data, and the … attribute the HTTP method used to send it.Show the answer
The action attribute of
formgives the address that receives the data, and the method attribute the HTTP method used to send it.Without
action, the form is sent to the address of the current page. Withoutmethod, it is GET.Label: what is it?
Show the answer
An element that names a form field; its
forattribute repeats the field'sid, and clicking it activates the field.A screen reader reads its text when reaching the field.
placeholderdoes not replace it: it disappears as soon as you type.