Radio buttons
Radio buttons in Cliq forms allow the users to choose one item from the list of all possible options. Given below is a table containing the attributes for the input field. All the mandatory parameters are indicated with a *.
Attribute Name | Data Type | Description |
type* | String Value should be radio | The type of the input field. Value of the field should be radio. |
name* | String (50) | A unique identifier for the field. Upon submitting a form, value defined for the key will be available in the function associated with the form. |
label* | String (50) | Denotes the display name of the field |
hint* | String (100) | Provides a brief description about the possible and the expected output. |
options* | Array (2-5) | An array of JSON object following the structure label and value. Note: The maximum number of elements allowed are 5. FORMAT { (or) |
value | String (50) | Provide a default input for the field by giving the value of any drop-down list item. |
mandatory | Boolean | Defines if the field requisite is mandatory or not. Note: The default value is considered as false. |
Syntax
{
"type":"radio",
"name":"",
"label":"",
"hint":"",
"trigger_on_change":false//boolean, default is set to false
"value":"",
"options":""
}
Sample Code
return {
"type":"form",
"title":"Customer Survey ",
"name":"survey",
"hint":"Help us understand what mattered most in your decision-making process.",
"button_label":"Submit",
"inputs":[
{
"label":"What influenced your choice to choose our service?",
"name":"radio",
"hint":"Select the primary reason you chose us.",
"mandatory":false,
"type":"radio",
"options":[
{
"value":"pricing",
"label":"Pricing"
},
{
"value":"features",
"label":"Features"
},
{
"value":"CustomerReviews",
"label":"Customer Reviews"
},
{
"value":"ReferralorRecommendation",
"label":"Referral or Recommendation"
}
]
}
],
"action":{
"type":"invoke.function",
"name":"function"
}
};