FormItem

FormItem

A FormItem object as defined in the JSON schema

Constructor

new FormItem(props)

Instantiates a new FormItem

Parameters:
Name Type Description
props object

Properties to initialize the form item with

Properties
Name Type Attributes Default Description
type 'string' | 'date' | 'datetime' | 'int' | 'float' | 'hidden' | 'form-menu' | 'email' | 'url' | 'location'

Sets FormItem#type

name string

Sets FormItem#name

description string

Sets FormItem#description

header string <optional>

Sets FormItem#header

footer string <optional>

Sets FormItem#footer

body Array.<MenuItemFormItem> <optional>

Sets FormItem#body

value string <optional>

Sets FormItem#value

chunkingFooter string <optional>

Sets FormItem#chunkingFooter

confirmationLabel string <optional>

Sets FormItem#confirmationLabel

minLength number <optional>

Sets FormItem#minLength. It must be integer.

minLengthError string <optional>

Sets FormItem#minLengthError

maxLength number <optional>

Sets FormItem#maxLength. It must be integer.

maxLengthError string <optional>

Sets FormItem#maxLengthError

minValue number <optional>

Sets FormItem#minValue

minValueError string <optional>

Sets FormItem#minValueError

maxValue number <optional>

Sets FormItem#maxValue

maxValueError string <optional>

Sets FormItem#maxValueError

meta MenuFormItemMeta <optional>

Sets FormItem#meta

method string <optional>

Sets FormItem#method

required boolean <optional>
false

Sets FormItem#required

statusExclude boolean <optional>
false

Sets FormItem#statusExclude

statusPrepend boolean <optional>
false

Sets FormItem#statusPrepend

url string <optional>

Sets FormItem#url

validateTypeError string <optional>

Sets FormItem#validateTypeError

validateTypeErrorFooter string <optional>

Sets FormItem#validateTypeErrorFooter

validateUrl string <optional>

Sets FormItem#validateUrl

Source:

Members

body :Array.<MenuItemFormItem>

This is the FormItem's body.

Source:

chunkingFooter :string

This is the FormItem's chunking footer.

Source:

confirmationLabel :string

This is the FormItem's confirmation label.

Source:

description :string

This is the FormItem's displayed text.

Source:

This is the FormItem's footer. If defined, it overrides Form#footer.

Source:

This is the FormItem's header. If defined, it overrides Form#header.

Source:

maxLength :number

This defines the maximum length of the input if FormItem#type is string. It must be an integer.

Source:

maxLengthError :string

This is the error for FormItem#maxLength.

Source:

maxValue :number

This defines the maximum value of the input if FormItem#type is int or float.

Source:

meta :MenuFormItemMeta

This must be defined if FormItem#type is form-item.

Source:

method :string

This is the FormItem's method.

Source:

minLength :number

This defines the minimum length of the input if FormItem#type is string. It must be an integer.

Source:

minLengthError :string

This is the error for FormItem#minLength.

Source:

minValue :number

This defines the minimum value of the input if FormItem#type is int or float.

Source:

minValueError :string

This is the error for FormItem#minValue.

Source:

minValueError :string

This is the error for FormItem#maxValue.

Source:

name :string

This is the FormItem's name. Each form item name must be unique within the same form.

Source:

required :boolean

Whether the form item is required to be answered or not.

Default Value:
  • false
Source:

statusExclude :boolean

Whether the form item's status should be excluded or not.

Default Value:
  • false
Source:

statusPrepend :boolean

Whether the form item's status should be prepended or not.

Default Value:
  • false
Source:

type :string

This is the FormItem's type

Source:

url :string

This is the FormItem's url.

Source:

validateTypeError :string

This is the FormItem's validation type error.

Source:

validateTypeErrorFooter :string

This is the FormItem's validation type error footer.

Source:

validateUrl :string

This is the FormItem's validation url.

Source:

value :string

value must be set only if FormItem#type is hidden.

Source:

Methods

(static) fromTag(sectionTag) → {FormItem}

Creates a FormItem from a SectionTag

Parameters:
Name Type Description
sectionTag SectionTag
Source: