Phone
Lets users input their phone numbers with the country code of their choice or to validate a pre-filled country.
To create a phone input, define the field type as "phone_number". The list of attributes passed for this input field is given below. The following are the attributes associated with this input field.
Attribute Name | Data Type | Description |
type* | String Value "phone_number" | Specifies the type of the input field. |
name* | String (50) | Unique identifier for the field. |
label* | String (50) | Sample field value displayed to the user that describes the expected value of the input field. |
hint | String (100) | Provides a brief description of the field's purpose and the expected input. |
label* | string (50) | Describes the field display name. |
placeholder* | String (100) | Sample field value displayed to the user, describing the expected input for the phone number. |
value | Object | The default value of the field provided with phone number & country code in a three-letter lowercase (ISO alpha-3) code format.
|
filter | Object | Define a set of allowable country codes. This restricts users to select only from the specified set.
|
mandatory | Boolean | Defines if the form field is mandatory or optional. |
disabled | Boolean | Defines if the form field is disabled or enabled. |
ⓘ All mandatory attributes are indicated with a * and the maximum characters allowed is provided with the Data Type.
Sample JSON
{
"type": "phone_number",
"name": "customer_contact",
"label": "Customer Contact Number",
"hint": "Enter customer's contact number with country code.",
"placeholder": "Enter your contact number",
"value": {
"phone_number": "7271532401",
"country_code": "ind"
},
"filter": {
"country_code": ["aus","chn","ind","sgp","usa"]
},
"mandatory": true,
"disabled": false
}
Deluge Script - Slash Command
contact_input = {"type": "phone_number","name": "customer_contact","label": "Customer Contact Number","hint": "Enter customer's contact number with country code.","placeholder": "Enter your contact number","value": {"phone_number": "7271532401","country_code": "ind"},"filter": {"country_code": ["aus","chn","ind","sgp","usa"]},"mandatory": true,"disabled": false};
return {"type":"form","title":"Phone Number Input","name":"contactForm","hint":"Cliq Form - Phone Number Input Sample","button_label":"Submit","inputs":{contact_input},"action":{"type":"invoke.function","name":"formFunc"}};