TX Text Control .NET Server

Javascript: TextField.setText Method

Method|Introduced in 28.0

Description

Sets the text which is contained within a text field.

Syntax

<void> TextField.setText(<string> text, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
text

The text which is contained within a text field.

callback

Optional. Is called when the operation completed.

errorCallback

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

Examples

The following example demonstrates TextField.setText in a practical document-editing workflow. It sets the text which is contained within a text field.

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

function configureText(textField) {
    textField.setText(
        "Quarterly report",
        function() {
            console.log("set text completed.");
        },
        onTxError
    );
}