Help people get it right.
Visible labels, useful hints, validation and recoverable errors.
Interactive example
This local example validates a name and sends no data. Add application validation on the server as well as in the browser.
Code
<form id="example-form" novalidate><div class="sk-field"><label for="example-name">Your name</label><input class="sk-input" id="example-name" name="name" autocomplete="name" required aria-describedby="name-hint name-error"><span class="sk-hint" id="name-hint">Use the name you would like us to use.</span><span class="sk-error" id="name-error" hidden>Enter your name to continue.</span></div><div class="sk-field"><label for="example-discipline">Discipline</label><select class="sk-input" id="example-discipline" name="discipline"><option>Design</option><option>Engineering</option><option>Content</option></select></div><label class="sk-check"><input type="checkbox" name="updates"> Include the optional design update</label><button class="sk-button" type="submit">Validate example <span aria-hidden="true">→</span></button><p id="form-result" role="status"></p></form>Usage
- Use visible labels; placeholder text does not replace a label.
- Link hints and errors using aria-describedby. Set aria-invalid only after validation fails.
- For long forms, add an error summary linking to each invalid field.
- Use autocomplete and appropriate input types. Make optional fields explicit.
- Do not collect sensitive information without a defined purpose, retention period and secure service.

