1. Fields
  2. MultiCheckbox Field

Fields

MultiCheckbox Field

The MultiCheckbox Field allows for selecting multiple items from a list.

This can be used to check items from any list, such as a list of colors, months in a year, list of countries, etc.

Basic usage

Adds a multicheckbox field to the fields of an action.

editor
        {
    "flight_options": {
    "fieldtype": "multicheckbox",
    "params": {
      "options": {
        "priority-boarding": {
          "additional_data_point": {
            "foo": "bar"
          }
        },
        "checked-baggage": {
          "label": "Would you like checked baggage?"
        },
        "in-flight-meal": {}
      },
    },
    "name": "multicheckbox_field",
    "__key": "multicheckbox_field"
  }
}

      

Result

The field will be displayed as multiple checkboxes in the form, as below:

The resultant data will be available in the stubpost.data as:

loading...

The values that were selected are available in the stubpost.data as an array of objects, where each object has a label and a value.

This can be substituted with eg. ~~stubpost.data.flight_options where required.

Parameters

params.options
required
object

This parameter specifies the list of items that the user can check. Each item in the object should be and object. The object can be empty.

The keys of each object are used to display to option.

params.options.*.label
required
string

This parameter specifies the text that will be displayed to the user.

See fields for common parameters