Phase 8 — Accessible Forms Allowed
This gauge covers Chapter 12 after Responsive CSS and Pseudo-elements.
Learning goal
Build forms whose controls have clear names, instructions, groups, purposes, and actions before adding visual presentation.
Inherited tools
Everything allowed through ../responsive/allowed.md remains available.
New HTML
formlabelselect,optionoptgroupdatalisttextareafieldset,legendoutputprogressmeter
The inherited input, button, p, span, and structural elements may now be
used as parts of complete forms.
Form attributes
- On
form:action,method,novalidate - On labelable controls:
id,name,required,disabled - On
input: appropriatetype,value,placeholder,autocomplete,min,max,step,minlength,maxlength,checked,list,accept,multiple - On
label:for - On
select:multiple - On
option:value,selected - On
optgroup:label,disabled - On
datalist:id - On
textarea:rows,cols,placeholder - On
output:for,name - On
progress:value,max - On
meter:value,min,max,low,high,optimum - For help text:
aria-describedby - For required or invalid state only when native HTML cannot express it:
aria-required,aria-invalid
Input types
In addition to the inherited types used in earlier lessons:
searchurldatenumberfilerangecolorhidden
Learning rules
- Give every control a visible label. Prefer an explicit
label formatching the control's uniqueid. - A placeholder is an example or hint, not a replacement for a label.
- Use the input type that matches the requested data so browsers can provide suitable keyboards, validation, and autofill behavior.
- Give submitted controls meaningful
namevalues. Controls without a name are not included in ordinary form submission. - Use
autocompletetokens when the purpose maps to known user information. - Group related radio buttons or checkboxes with
fieldsetand describe the group withlegend. - Associate persistent instructions with a control using
aria-describedbywhen the relationship is not already clear. - Use native
required, length, and range constraints before recreating them with ARIA. Do not addaria-requiredwhenrequiredalready expresses it. - Identify required fields in text, not by colour alone.
- Give every
buttonan explicit type. Usesubmitfor submission,resetonly when clearing is genuinely useful, andbuttonfor non-submit actions. - Keep focus indicators visible and keep source order aligned with the intended reading and keyboard order.
- Do not rely on colour, placeholder disappearance, or browser validation alone to explain what data is expected.
- Use
optgroupwith a visiblelabelwhen a long select benefits from meaningful categories. - Connect an input's
listattribute to a datalist'sid. Datalist options are suggestions; unlike select options, they do not restrict other values. - Give specialized inputs visible labels and persistent format instructions. Browser interfaces for date, file, range, and colour controls vary.
- Use
acceptto suggest suitable file types, but validate files on the server because browser filtering is not a security boundary. - A hidden input is not interactive and does not need a visible label. Never treat its value as secret or trustworthy merely because it is hidden.
- Give
outputan accessible name and useforto identify the controls that contribute to its result. - Use
progressfor task completion andmeterfor a scalar measurement within a known range. Include adjacent text that communicates the value. - Use native range attributes: progress begins at zero, while meter may also
define
min,low,high, andoptimum. - An input-group addon is supplementary. Keep a visible label (or group name)
and connect helpful addon text with
aria-describedbywhen needed. - Style switches as real checkboxes. Do not rebuild toggle behaviour with empty elements in this chapter.
Not allowed
- JavaScript or scripted validation
- Custom controls that replace native inputs, selects, textareas, or buttons
- Essential instructions shown only in placeholders
- Positive
tabindexvalues or CSS visual reordering of form controls - ARIA that duplicates or conflicts with native HTML
- Datalist suggestions presented as enforced choices
- Client-side file filtering presented as file validation
- Secrets or trusted authorization data stored in hidden inputs
progressused for an ordinary measurement ormeterused for task progress- Inline styles
- Any HTML tag, attribute, or CSS property not inherited or listed above
Pages
01-labels-inputs.html— form structure, explicit labels, names, types, and autocomplete02-select-textarea.html— select menus, options, textareas, and persistent instructions03-groups-actions.html— fieldsets, legends, grouped choices, required state, and button types04-complete-form.html— a responsive accessible form combining the chapter rules05-suggestions-groups.html— datalist suggestions and labelled option groups06-specialized-inputs-status.html— specialized input types, output, progress, and meter07-input-groups.html— prefix and suffix addons beside labelled fields08-choice-styles.html— inline choices, disabled states, and checkbox switches
Rules to lean on
Rules 2, 32, 44, 54–59, 63, 72–80, 99–110, 111–122, 135–144, and later admin form presentation rules when studying Chapter 18.