TX Text Control .NET Server

Javascript: TextViewGeneratorColors.setFormFieldColor Method

Method|Introduced in 28.0

Description

Sets the default highlight color of a form field. To suppress highlighting the FormField the property value can be set to null.

Syntax

<void> TextViewGeneratorColors.setFormFieldColor(<string> color, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
color

The highlight color.

callback

Optional. Is called when the operation completed.

errorCallback

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

Examples

The following example demonstrates TextViewGeneratorColors.setFormFieldColor in a practical document-editing workflow. It sets the default highlight color of a form field. To suppress highlighting the FormField the property value can be set to null.

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

TXTextControl.displayColors.setFormFieldColor(
    "#ffd54f",
    function() {
        console.log("set form field color completed.");
    },
    onTxError
);