Phone

Single-line Input type: Telephone

To create a single-line input field of the type, telephone—use the format key and define the field value as tel. The list of attributes passed for this input field type is given below. All mandatory attributes are indicated with a * and the maximum characters allowed is provided with the Data Type. 

Attribute NameData TypeDescription
type*string 
Value should be text
The type of input field. For single line text input, type must be text
format*

string
Value should be tel

Use this key to define the text field format. Value for the input type email should tel
placeholder*string (100)Sample field value displayed to the user that describes the expected value of the input field.
name*string (50)A unique identifier for the field. On form submission, the value defined for this key will be available in the function associated with the form.
label*string (50)Describes the field display name.
hintstring (100)Provides a brief description of the field's purpose and the expected input.
max_lengthintegerSpecifies the maximum number of characters allowed as input.
min_lengthintegerSpecifies the minimum number of characters allowed as input.
valuestring (100)Provide a default input value for the field.
mandatorybooleanDefine if the field's requisite is mandatory or not.
Default value considered is true.

Syntax


{
  "type": "text",
  "format" : "tel",
  "name": "",
  "label": "",
  "hint": "",
  "placeholder": "",
  "mandatory":true , //boolean, default is true
  "value": "",
  "max_length": "",
  "min_length": ""
  }

Code Sample


inputs = list();
inputs.add({
  "type": "text",
  "format" : "tel",
  "name": "phone",
  "label": "Contact Number",
  "hint": "Give your registered phone number",
  "placeholder": "01234567890",
  "mandatory": true,
  "value": "01234567890"
  });
form = {
  "type": "form",
  "title": "ZylCal Users",
  "hint": "Submit your details to get early access to ZylTrix!",
  "name": "ID",
  "version": 1,
  "button_label": "Submit",
  "action": {
      "type": "invoke.function",
      "name": "userinfo"
  },
  "inputs": inputs
};
return form;

Share this post : FacebookTwitter

Still can't find what you're looking for?

Write to us: support@zohocliq.com