DS Server

Javascript: TXTextControl.select Method

Method|Introduced in 28.0

Description

Selects text within the control.

Syntax

<void> TXTextControl.select(<number> start, <number> length, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
start

Specifies the selection's start position

length

Specifies the number of selected characters.

callback

Optional. Is called when the operation completed.

errorCallback

Optional. Is called when the operation failed with an error.

Examples

The following example demonstrates TXTextControl.select in a practical document-editing workflow. It selects text within the control.

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

TXTextControl.select(
    1,
    5,
    function() {
        console.log("select completed.");
    },
    onTxError
);