DS Server

TextFormField Object

Object|Introduced in 28.0

Description

The TextFormField object represents a text input field on a form. It can be initially empty and it can have a horizontal extension, when it is empty.

Syntax

TextFormField

Examples

The following example demonstrates TextFormField in a practical document-editing workflow. The TextFormField object represents a text input field on a form. It can be initially empty and it can have a horizontal extension, when it is empty.

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

function inspectTextFormField(textFormField) {
    textFormField.getEmptyWidth(
        function(result) {
            console.log("get empty width result:", result);
        },
        onTxError
    );
}

Members

Methods

MethodDescription
getDescriptiveTextGets the form field's descriptive text. An empty string indicates that the link has no such text. (Inherited from FormField.)
getEmptyWidthGets the horizontal extension, in twips, of the text formfield, when it is empty.
getEnabledGets a value indicating whether the form field is enabled. (Inherited from FormField.)
setDescriptiveTextSets the form field's descriptive text. An empty string or null can be used to delete a previously set text. (Inherited from FormField.)
setEmptyWidthSets the horizontal extension, in twips, of the text formfield, when it is empty.
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. (Inherited from FormField.)