Single-line Input Field: Number

Attribute NameData TypeDescription
type*string
Value should be number
The type of input field. For single line text input, type must be number.
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.
maxintegerSpecifies the maximum value allowed as input.
minintegerSpecifies the minimum value allowed as input.
step_valueintegerDisplays a counter to increase or decrease numerical values in the field.
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": "",
  "name": "",
  "label": "",
  "hint": "",
  "placeholder": "",
  "mandatory": true, //boolean, default is set to true
  "value": "",
  "max": "",
  "min":""
  }

Code Sample


inputs = list();
inputs.add(
{
  "type": "number",
  "name": "ticket_details",
  "label": "Ticket ",
  "hint": "Please enter your ticket ID",
  "placeholder": "1234",
  "mandatory": true,
  "value": "1234",
  "max": "10000",
  "min": "100"
});
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;