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 | JSON Object | The default value of the field provided with phone number & country code in a three-letter lowercase (ISO alpha-3) code format.
|
filter | JSON 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"
}
};
Use Cliq's form builder to create rich, interactive, user-friendly forms. To get started, navigate to the form builder and drag and drop the form inputs you want to use to collect user information. The phone number input is now supported as well. You can specify the label name and placeholder, and add filters to include specific country codes or set a default predefined value.