FormFieldCollection Object
Description
The FormFieldCollection contains all form fields in a Text Control document or part of the document.
Syntax
FormFieldCollectionExamples
The following example demonstrates FormFieldCollection in a practical document-editing workflow. The FormFieldCollection contains all form fields in a Text Control document or part of the document.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
TXTextControl.textParts.getMainText(function(mainText) {
const formFields = mainText.formFields;
formFields.getItem(
function(formField) {
if (!formField) {
console.warn("No form field was returned.");
return;
}
console.log("get item result:", formField);
},
onTxError,
25
);
}, onTxError);Members
Methods
| Method | Description |
|---|---|
| addCheckFormField | Adds a new CheckFormField. |
| addDateFormField | Adds a new DateFormField. |
| addSelectionFormField | Adds a new SelectionFormField. |
| addTextFormField | Adds a new TextFormField. |
| elementAt | Returns the element at a specified index in the collection. (Inherited from Collection.) |
| forEach | Executes a callback function for each element. (Inherited from Collection.) |
| getCount | Gets the number of elements contained in the collection. (Inherited from Collection.) |
| getItem | Gets the form field at the current text input position or the form field with the specified id. |
| remove | Removes the form field from the Text Control document. |