TX Text Control .NET Server

Javascript: SignatureFieldCollection.getItem Method

Method|Introduced in 31.0

Description

Gets the signature field selected by the user or the signature field with the specified identifier.

Syntax

<void> SignatureFieldCollection.getItem(<RequestSignatureFieldCallback> callback, [<ErrorCallback> errorCallback], [<number> id])

Parameters

ParameterDescription
callback

Receives the requested signature field or null if there is no signature field at the current input position / with the specified identifier.

errorCallback

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

id

Optional. The signature field's identifier.

Examples

The following example demonstrates SignatureFieldCollection.getItem in a practical document-editing workflow. It gets the signature field selected by the user or the signature field with the specified identifier.

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

TXTextControl.signatureFields.getItem(
    function(signatureField) {
        if (!signatureField) {
            console.warn("No signature field was returned.");
            return;
        }
        
        console.log("get item result:", signatureField);
    },
    onTxError,
    25
);