Checkbox/Radio Control Adapter
Handles form elements which render a single input[type="checkbox"]
or input[type='radio']
element.
Registration
Checkbox
- and RadioFormElement
s are automatically created with the checkbox
type attribute.
This ensures that a checkbox control adapter is initialized on the node.
By removing the data-bootstrapui-adapter-type
attribute this can be prevented.
Target element
The input[type="checkbox"]
or input[type="radio"]
element on which the adapter is registered or which has been wrapped.
Retrieving the current value
Returns an array holding a single BootstrapUiControlValueHolder
if the target element is checked.
If it is not checked, an empty array is returned.
The context is the target element of the adapter.
The label holds the inner text of the linked label
element, or is not set if no label has been linked.
The value holds the value
attribute which is registered on the target element of the adapter.
// checked
adapter.selectValue( true );
[{
label: "Active",
value: "Yes",
context: input#ca-checkbox
}]
// unchecked
adapter.selectValue( false );
[]