Form control (input, select, textarea) helper functions.
- Source:
Methods
(static) clear(grp, event1, event2)
- Source:
Clears form input fields and triggers events when doing this.
Parameters:
Name | Type | Description |
---|---|---|
grp |
Element whose DESCENDANT form controls to clear |
|
event1 |
first event to trigger |
|
event2 |
second event to trigger |
(static) find(name, index) → {Element}
- Source:
Finds a form control that is not a nested xforms-value-changed action
Parameters:
Name | Type | Description |
---|---|---|
name |
string | name attribute value |
index |
number | repeat index |
Returns:
found element
- Type
- Element
(static) getCalculation(control) → {string}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
control |
Element | form control HTML element |
Returns:
calculate expression
- Type
- string
(static) getConstraint(control) → {string}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
control |
Element | form control HTML element |
Returns:
constraint expression
- Type
- string
(static) getIndex(control) → {number}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
control |
Element | form control HTML element |
Returns:
- the repeat index of the form control
- Type
- number
(static) getInputType(control) → {string}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
control |
Element | form control HTML element |
Returns:
input type
- Type
- string
(static) getName(control) → {string}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
control |
Element | form control HTML element |
Returns:
name
- Type
- string
(static) getProps(control) → {object}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
control |
Element | form control HTML element |
Returns:
control element properties
- Type
- object
(static) getReadonly(control) → {boolean}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
control |
Element | form control HTML element |
Returns:
whether element is read only
- Type
- boolean
(static) getRelevant(control) → {string}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
control |
Element | form control HTML element |
Returns:
relevant expression
- Type
- string
(static) getRequired(control) → {string|undefined}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
control |
Element | form control HTML element |
Returns:
required expression
- Type
- string | undefined
(static) getVal(control) → {string}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
control |
Element | form control HTML element |
Returns:
element value
- Type
- string
(static) getWrapNode(control) → {Element}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
control |
Element | form control HTML element |
Returns:
Wrap node
- Type
- Element
(static) getWrapNodes(controls) → {Array.<Element>}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
controls |
Array.<Element> | form controls HTML elements |
Returns:
Wrap nodes
- Type
- Array.<Element>
(static) getXmlType(control) → {string}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
control |
Element | form control HTML element |
Returns:
XML type
- Type
- string
(static) isEnabled(control) → {boolean}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
control |
Element | form control HTML element |
Returns:
whether element is enabled
- Type
- boolean
(static) isMultiple(control) → {boolean}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
control |
Element | form control HTML element |
Returns:
whether element is multiple
- Type
- boolean
(static) setVal(control, value, eventopt) → {Element}
- Source:
Sets the value of a form control (or group like radiobuttons)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
control |
Element | form control HTML element |
|
value |
string | number | value to set |
|
event |
Event |
<optional> |
event to fire after setting value |
Returns:
first control whose value was set
- Type
- Element
(static) validate(control) → {Promise.<(undefined|ValidateInputResolution)>}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
control |
Element | form control HTML element |
Returns:
Promise that resolves
- Type
- Promise.<(undefined|ValidateInputResolution)>