Radio buttons
Radio buttons in 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.
Attribute Name | Datatype | 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 form submission, value defined for this key will be available in the function associated with the form. |
label* | String (150) | Describes the display name for this field. |
hint | String (100) | Provides a brief description of the fields purpose and the expected input. |
options* | Array | An array of JSON object following the structure label and value. Note: The maximum number of options allowed is 100 FORMAT { |
value | String(100) | Provide a default input for the field by giving the value of any drop-down list item. |
mandatory | Boolean | Defines if the field's requisite is mandatory or not. Note: Default value is considered to be false. |
disabled | Boolean | If disabled is true, then the field will not be editable |
trigger_on_change | Boolean | If this is enabled for a field or an input, then the change handler will be invoked when the value of that field is changed |
Sample Code:
Copied{
"type":"radio",
"name":"radio",
"label":"Radio",
"hint":"Let us know if you're interested in receiving our newsletter",
"mandatory":false,
"trigger_on_change":true,
"value":"yes",
"options":[
{
"label":"Yes",
"value":"yes"
},
{
"label":"No",
"value":"no"
}
],
"disabled" : true
}
JSON format passed in handlers for the filled-in value:
Copied{
"meta":{
"type":"radio",
"value":"yes"
},
"value":{
"label":"Yes",
"value":"yes"
}
}