DS Server

Javascript: TXTextControl.getIsFormFieldValidationEnabled Method

Method|Introduced in 31.0

Description

Gets a value indicating whether form field validation is active or not.

Syntax

<void> TXTextControl.getIsFormFieldValidationEnabled(<RequestBooleanCallback> callback, [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
callback

Receives the property value.

errorCallback

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

Examples

The following example demonstrates TXTextControl.getIsFormFieldValidationEnabled in a practical document-editing workflow. It gets a value indicating whether form field validation is active or not.

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

TXTextControl.getIsFormFieldValidationEnabled(
    function(result) {
        if (result) {
            console.log("get is form field validation enabled is available.");
        } else {
            console.warn("get is form field validation enabled is not available in the current document state.");
        }
    },
    onTxError
);