hidden input
An <input type="hidden"> that is not shown but whose value is sent when the form is submitted.
In more detail
Custom controls such as a switch built from a button are not real form fields. Adding a hidden input that mirrors their value lets them take part in ordinary form submission.
Related terms
- form control — An element that collects user input, such as a text input, checkbox, switch, select or button.
- switch role — The ARIA role for an on/off control whose change takes effect immediately, like a light switch.
Taught in
- Actionable Form Primitives: Buttons, Switches & Inputs — Design Systems & Component Engineering