TX Text Control .NET Server

FormField Object

Object|Introduced in 28.0

Description

Represents a form field.

Syntax

FormField

Examples

The following example demonstrates FormField in a practical document-editing workflow. It represents a form field.

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

TXTextControl.textParts.getMainText(function(mainText) {
    const formFields = mainText.formFields;
    formFields.getItem(function(formField) {
        if (!formField) {
            console.warn("No form field is available at the current input position.");
            return;
        }
    
        formField.getChecked(
            function(result) {
                if (result) {
                    console.log("get checked is available.");
                } else {
                    console.warn("get checked is not available in the current document state.");
                }
            },
            onTxError
        );
    }, onTxError);
}, onTxError);

Members

Methods

MethodDescription
getBoundsGets the bounding rectangle of a text field. (Inherited from TextField.)
getContainsInputPositionReturns true, if the Textfield contains the current text input position. (Inherited from TextField.)
getDeleteableGets whether a text field can be deleted by the end-user while a TX Text Control document is being edited. (Inherited from TextField.)
getDescriptiveTextGets the form field's descriptive text. An empty string indicates that the link has no such text.
getDoubledInputPositionSets whether a text field has a doubled input position in front of its first character and behind its last character. (Inherited from TextField.)
getEditableGets whether the text of a text field can be changed by the end-user while a TX Text Control document is being edited. (Inherited from TextField.)
getEnabledGets a value indicating whether the form field is enabled.
getFormattingBoundsGets the formatting rectangle of a text field. (Inherited from TextField.)
getHighlightColorGets the highlight color for the text field. (Inherited from TextField.)
getHighlightModeGets a value indicating when the text field is highlighted. (Inherited from TextField.)
getIDGets an identifier for a text field. (Inherited from TextField.)
getIsSpellCheckingEnabledGets whether a text field's text is checked on misspelled words. (Inherited from TextField.)
getLengthGets the number of characters in a text field. (Inherited from TextField.)
getNameRelates a user-defined name to a text field. (Inherited from TextField.)
getStartGets the first character position (one-based) of a text field. (Inherited from TextField.)
getTextGets the text which is contained within a text field. (Inherited from TextField.)
scrollToSets the current input position to the beginning of a text field and scrolls it into the visible part of the document. (Inherited from TextField.)
setDeleteableSets whether a text field can be deleted by the end-user while a TX Text Control document is being edited. (Inherited from TextField.)
setDescriptiveTextSets the form field's descriptive text. An empty string or null can be used to delete a previously set text.
setDoubledInputPositionGets whether a text field has a doubled input position in front of its first character and behind its last character. (Inherited from TextField.)
setEditableSets whether the text of a text field can be changed by the end-user while a TX Text Control document is being edited. (Inherited from TextField.)
setEnabledSets a value indicating whether the form field is enabled. This property has only an effect, when the when the edit mode is set to TXTextControl.EditMode.ReadAndSelect and the allowEditingFormFields property of the document permissions has been set to true. In this case a Formfield can only be edited, when its Enabled property is true. When a FormField is disabled, the TextFieldClicked and TextFieldDoubleClicked of the Formfield are suppressed. The default value of this property is true.
setHighlightColorSets the highlight color for the text field. (Inherited from TextField.)
setHighlightModeSets a value indicating when the text field is highlighted. (Inherited from TextField.)
setIDSets an identifier for the text field. (Inherited from TextField.)
setIsSpellCheckingEnabledGets whether a text field's text is checked on misspelled words. (Inherited from TextField.)
setNameSets the name of a text field. (Inherited from TextField.)
setTextSets the text which is contained within a text field. (Inherited from TextField.)