Checkbox Fields in Forms
Checkbox fields in Cliq forms allow users to select one or more options from the list of options provided. A list of attributes passed for this field are given below. All the mandatory parameters are indicated with a * and the maximum characters allowed is provided with the Data Type.
Attribute Name | Data Type & Limit | Description |
type* | String Value should be checkbox | The type of the input field. Value of the field should be checkbox. |
name* | String (50) | A unique identifier for the field. Upon form submission, value defined for this key will be available in the function associated with the form. |
label* | String (50) | Describes the display name for this field. |
hint | String (100) | Provides a brief description of the fields purpose and the expected input. |
max_selections | Integer (5) | Specifies the maximum number of selections that the user can make. |
options* | Array (1-5) | An array of JSON object following the structure label and value. Label indicates the display text for each checkbox and value represents the value associated with each checkbox option. Note: The maximum number of options allowed is 5. FORMAT { label: $label, (Maximum allowed characters: 100)
} |
value | String (250) | Provide a default input value for the field. This should be same as the values defined in the options array. You can pass multiple values separated by commas. |
mandatory | Boolean | Defines if the field's requisite is mandatory or not. Note: Default value is considered to be false. |
Syntax
{
"type":"checkbox",
"name":"",
"label":"",
"hint":"",
"max_selections":"",
"options":{
{
"label":"",
"value":""
},
{
"label":"",
"value":""
},
{
"label":"",
"value":""
},
{
"label":"",
"value":""
},
{
"label":"",
"value":""
}
}"value":"",
"mandatory":false //Default value is false
}
Code sample
return {
"type":"form",
"title":"Project Status Check",
"name":"marathon",
"hint":"Select the items that are completed or currently in progress to indicate the project's status.",
"button_label":"Submit",
"inputs":[
{
"label":"Project Management Stage",
"name":"projectdetails",
"hint":"Choose the status of the current project",
"mandatory":false,
"type":"checkbox",
"options":[
{
"value":"planning",
"label":"Project Planning"
},
{
"value":"scheduling",
"label":"Task Scheduling"
},
{
"value":"management",
"label":"Budget Management"
},
{
"value":"RiskAssessment",
"label":"Risk Assessment"
}
]
}
],
"action":{
"type":"invoke.function",
"name":"function"
}
};