Javascript: TXTextControl.select Method
Description
Selects text within the control.
Syntax
<void> TXTextControl.select(<number> start, <number> length, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| 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
);