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 NameData TypeDescription
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

{
label: $label, (Maximum allowed characters: 100)
value: $value (Maximum allowed characters: 50)
}

(or)

{
options:[{label, value}]
}

valueString (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


inputs = list();
feedbacks = [{"label":"Good","value":"good"},{"label":"Average","value":"average"},{"label":"Bad","value":"bad"}];
inputs.add({"type":"radio","name":"radio","label":"Please enter your feedback","trigger_on_change":true,"options":feedbacks});
form = {"type":"form","hint":"Give your feedback on the webinar","title":"ZylCal Feedback","name":"ID","version":1,"actions":{"submit":{"type":"invoke.function","name":"userinfo"}},"inputs":inputs};
return form;