DS Server

TextField Object

Object|Introduced in 28.0

Description

Represents a text field in a document. A text field is a marked piece of text that has properties like text or a name.

Syntax

TextField

Examples

The following example demonstrates TextField in a practical document-editing workflow. It represents a text field in a document. A text field is a marked piece of text that has properties like text or a name.

function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

function inspectTextField(textField) {
    textField.getID(
        function(result) {
            console.log("get id result:", result);
        },
        onTxError
    );
}

Members

Methods

MethodDescription
getBoundsGets the bounding rectangle of a text field.
getContainsInputPositionReturns true, if the Textfield contains the current text input position.
getDeleteableGets whether a text field can be deleted by the end-user while a TX Text Control document is being edited.
getDoubledInputPositionSets whether a text field has a doubled input position in front of its first character and behind its last character.
getEditableGets whether the text of a text field can be changed by the end-user while a TX Text Control document is being edited.
getFormattingBoundsGets the formatting rectangle of a text field.
getHighlightColorGets the highlight color for the text field.
getHighlightModeGets a value indicating when the text field is highlighted.
getIDGets an identifier for a text field.
getIsSpellCheckingEnabledGets whether a text field's text is checked on misspelled words.
getLengthGets the number of characters in a text field.
getNameRelates a user-defined name to a text field.
getStartGets the first character position (one-based) of a text field.
getTextGets the text which is contained within a text field.
scrollToSets the current input position to the beginning of a text field and scrolls it into the visible part of the document.
setDeleteableSets whether a text field can be deleted by the end-user while a TX Text Control document is being edited.
setDoubledInputPositionGets whether a text field has a doubled input position in front of its first character and behind its last character.
setEditableSets whether the text of a text field can be changed by the end-user while a TX Text Control document is being edited.
setHighlightColorSets the highlight color for the text field.
setHighlightModeSets a value indicating when the text field is highlighted.
setIDSets an identifier for the text field.
setIsSpellCheckingEnabledGets whether a text field's text is checked on misspelled words.
setNameSets the name of a text field.
setTextSets the text which is contained within a text field.