Constructor
new FormItem(props)
Instantiates a new FormItem
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object |
Properties to initialize the form item with Properties
|
Members
body :Array.<MenuItemFormItem>
Composed of MenuItemFormItem
objects
required only for type=form-menu
.
chunkingFooter :string
Shown in the footer of the sms chunks.
confirmationLabel :string
Shown in the confirmation menu.
default :string
A default value in case of non required form items
description :string
The description of this FormItem
.
footer :string
If provided will overwrite the Form#footer
.
header :string
If provided will overwrite the Form#header
.
maxLength :number
Validates the user input
applies only for type=string
.
maxLengthError :string
Message to be shown on maxLength
error.
maxValue :number
Validates the user input
applies only for type=int|float
.
maxValueError :string
Message to be shown on maxValue
error.
meta :MenuFormItemMeta
MenuFormItemMeta
object
applies only for type=form-menu
.
method :string
HTTP method, how the callback url should be triggered.
minLength :number
Validates the user input
applies only for type=string
.
minLengthError :string
Message to be shown on minLength
error.
minValue :number
Validates the user input
applies only for type=int|float
.
minValueError :string
Message to be shown on minValue
error.
name :string
The name of this FormItem
, used in form serialization.
onLoginFailure :string
Optional path to redirect on login failure, valid when type='login'
onLoginSuccess :string
Optional path to redirect on login success, valid when type='login'
onLogoutFailure :string
Optional path to redirect on logout failure, valid when type='logout'
onLogoutSuccess :string
Optional path to redirect on logout success, valid when type='logout'
pattern :string|null
ECMA Script regex pattern string
applies only for type=regex
.
required :boolean
User can SKIP
this FormItem
if set to false
statusExclude :boolean
If true
this step will be excluded from the form completion status.
statusPrepend :boolean
If true
this step will be prepended to the body of the response. Appended otherwise.
step :number
specifies the legal number intervals for input field
type :string
Indicates the type of the object.
url :string
Callback url triggered right after the choice has been set for this form item.
validateTypeError :string
An error message to be shown on basic type validation.
validateTypeErrorFooter :string
Shown in the error message footer.
validateUrl :string
The callback url path "GET"
triggered to validate user input.
A query string is sent by ONEm: ?form_item_name=user_input
The validate_url must return a json response:
{"valid": true/false, "error": "Some message in case of validation errors"}
.
value :string
Value to pass in the form serialization data _.
Methods
(static) fromTag(sectionTag) → {FormItem}
Creates a FormItem from a SectionTag
Parameters:
Name | Type | Description |
---|---|---|
sectionTag |
SectionTag |