TextFieldCollection Object
Description
Contains all standard text fields in a Text Control document or part of the document.
Syntax
TextFieldCollectionExamples
The following example demonstrates TextFieldCollection in a practical document-editing workflow. It contains all standard text 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 textFields = mainText.textFields;
textFields.getItem(
function(field) {
if (!field) {
console.warn("No text field was returned.");
return;
}
console.log("get item result:", field);
},
onTxError,
25
);
}, onTxError);Members
Methods
| Method | Description |
|---|---|
| add | Adds a new TextField to the collection. |
| addWithText | Adds a new TextField with the given text to the collection. |
| clear | Removes all text fields from a Text Control document. |
| 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 text field at the current text input position or the text field with the specified id. |
| remove | Removes the text field from the Text Control document. |