TX Text Control .NET Server

Javascript: TXTextControl.ApplicationField.typeName Property

Property|Introduced in 25.0

Description

The merge field type ("MERGEFIELD", "DATE", "IF" etc.).

Syntax

<string> TXTextControl.ApplicationField.typeName

Examples

The following example demonstrates TXTextControl.ApplicationField.typeName in a practical document-editing workflow. The merge field type ("MERGEFIELD", "DATE", "IF" etc.).

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

TXTextControl.textParts.getMainText(function(mainText) {
    const applicationFields = mainText.applicationFields;
    applicationFields.getItem(function(applicationField) {
        if (!applicationField) {
            console.warn("No application field is available at the current input position.");
            return;
        }
    
        const typeName = applicationField.typeName;
        console.log("type name:", typeName);
    }, onTxError);
}, onTxError);