TX Text Control .NET Server

Javascript: TXTextControl.clear Method

Method|Introduced in 28.0

Description

Clears the selected text or the character right from the current input position.

Syntax

<void> TXTextControl.clear([<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
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.clear in a practical document-editing workflow. Clears the selected text or the character right from the current input position.

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

TXTextControl.clear(
    function() {
        console.log("clear completed.");
    },
    onTxError
);