Skip to content

Field single-checkbox

The field can be used as a radio button or to select a single value out of two.

Params

values Optional

  • Type: [any, any]. If this parameter is passed, then the included parameter will correspond to values[0] value, and off values[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 Tab and Shift + Tab.
  • Selecting an element is possible by clicking on the element itself.
  • The choice is possible by pressing Enter or Space.
  • Blocking fields cancels navigation using Tab. There is also a change in the style of single-checkbox.
  • If the validation fails, the field should change the single-checkbox style.

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
{}
{}

Released under the MIT License.