Forms
Building user input
Central classes
form__control
is used on inputs and selects to set a common standard close to the browser defaults.form__label
is used on labels for inputs that useform__control
.form__check
is for checkboxes andform__radio
for radio inputs, no need to set a class on the accompanying labels.
Resources
- Help and information is especially useful in forms.
- Accessibility in forms.
Disabling inputs
Disabled inputs can be removed most of the time or, if the input is always disabled, it can be a text of the output instead. A relevant example is postal code search that fetches the city automatically. Postal code is input, city would then be output.
When we actually have to disable inputs, we use the disabled
attribute. This
sets the style automatically.