Field single-checkbox
The field can be used as a radio button or to select a single value out of two.
- Keyword
single-checkbox. - WhatWG Specification.
Params
values Optional
- Type:
[any, any]. If this parameter is passed, then the included parameter will correspond tovalues[0]value, and offvalues[1].
Also, all parameters common to all FormField. Information about them can be found on this page.
Value
If the values parameter was not passed, then the value will be true - enabled, false - disabled. In the case where values is passed, the included value will match values[0], and off the remaining value.
Specification
- The field is available when using
TabandShift + Tab. - Selecting an element is possible by clicking on the element itself.
- The choice is possible by pressing
EnterorSpace. - Blocking fields cancels navigation using
Tab. There is also a change in the style ofsingle-checkbox. - If the validation fails, the field should change the
single-checkboxstyle.
Examples
There are no additional-required parameters for this field, so we need to specify only type and name:
html
<form-field name = "hasPhone" type="single-checkbox"/><form-field name = "hasPhone" type="single-checkbox"/>ts
import {FormField} from "jenesius-vue-form";import {FormField} from "jenesius-vue-form";Default field:
Is Admin
In locked state:
Disabled
Field not validated:
With Error
Seleact this fields
Field with passed values: ['yes', 'no']
With passed values
The current state of the form:
ts
{}{}