Aria Plugin
Adds ARIA accessibility attributes to form fields, enabling screen readers to announce validation errors.
Options
This plugin has no configurable options beyond enabled.
| Option | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Enable or disable the plugin |
Playground
When a field is invalid, the input receives aria-invalid="true" and aria-describedby pointing to the error container. When valid, aria-invalid="false" and aria-describedby is removed. The status line below the form shows the current attribute values.
Notes
- Sets
aria-invalid="true"on invalid elements andaria-invalid="false"on valid elements after each validation run. - When used alongside the
Messageplugin, also setsaria-describedbyon the field pointing to the error container, androle="alert"on the container so screen readers announce new errors automatically. - Works without
Message— onlyaria-invalidis set in that case. - For radio/checkbox groups,
aria-describedbyis set on all elements in the group. - Container
idandroleattributes are cleaned up when a field transitions back to valid.