Checkbox Field

The checkbox field.

Properties

Title Checkbox
Description Checkbox Field for boolean (true/false), string ('true', 'false' or comma-delimited string of values) or data array.
Field Type checkbox
Base Field Type list

Schema

Property Type Default Description
enum array List of field value options

Options

Property Type Default Description
dataSource string Data source for generating list of options. This can be a string or a function. If a string, it is considered to be a URI to a service that produces a object containing key/value pairs or an array of elements of structure {'text': '', 'value': ''}. This can also be a function that is called to produce the same list.
hideNone boolean Whether to hide the None option from a list (select, radio or otherwise). This will be true if the field is required and false otherwise.
join function For multiple select lists. Defines a f(a) for how selected options should be combined into a single string. A split function should also be defined which reverses this function.
multiple boolean Whether to render multiple checkboxes for multi-valued type (such as an array or a comma-delimited string)
name string Field Name.
noneLabel string None The label to use for the 'None' option in a list (select, radio or otherwise).
removeDefaultNone boolean If true, the default 'None' option will not be shown.
rightLabel string Optional right-hand side label for single checkbox field.
sort function Defines an f(a,b) sort function for the array of enumerated values [{text, value}]. This is used to sort enum and optionLabels as well as results that come back from any data sources (for select and radio controls). By default the items are sorted alphabetically. Don't apply any sorting if false.
split function For multiple select lists. Defines a f(a) for how data strings should be split into individual values. A join function should also be defined which reverses this function.
useDataSourceAsEnum boolean true Whether to constrain the field's schema enum property to the values that come back from the data source.

Example 1

Simple checkbox field for boolean data.

{% raw %} {% endraw %}

Example 2

Checkbox field with both field label and right label.

{% raw %} {% endraw %}

Example 3

Simple checkbox field rendered in display-only mode.

{% raw %} {% endraw %}

Example 4

Checkbox Field used for multiple values provided as an array.

{% raw %} {% endraw %}

Example 5

Checkbox Field used for multiple values provided as a comma-delimited string. We also hook up some form buttons to get at the JSON. Click the "View JSON" button to see it.

{% raw %} {% endraw %}

Example 6

Checkbox Field for multiple values with it's selection options loaded from a data source.

{% raw %} {% endraw %}

Example 7

A checkbox field that uses an enumerated value set on an array to specify the selection options. This is in accordance with JSON schema v4.

{% raw %} {% endraw %}

Example 8

Checkbox Field as a dependency

{% raw %} {% endraw %}

Example 9

Checkbox Field with custom delimiters

{% raw %} {% endraw %}