# FormField Object

> Represents a form field.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Object
- **Introduced:** 28.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > FormField Object
- **2283 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/formfield/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/formfield/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/formfield/llms-full.txt

---

### Description

Represents a form field.

### Syntax

```javascript
FormField
```

### Examples

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

```javascript
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);
```

---

## In This Section

- [Javascript: FormField.getDescriptiveText Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/formfield/getdescriptivetext-method/llms-full.txt): Gets the form field's descriptive text. An empty string indicates that the link has no such text.
- [Javascript: FormField.getEnabled Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/formfield/getenabled-method/llms-full.txt): Gets a value indicating whether the form field is enabled.
- [Javascript: FormField.setDescriptiveText Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/formfield/setdescriptivetext-method/llms-full.txt): Sets the form field's descriptive text. An empty string or null can be used to delete a previously set text.
- [Javascript: FormField.setEnabled Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/formfield/setenabled-method/llms-full.txt): Sets 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.

---

## Nearby

- **Previous:** [Javascript: FormattingStyleCollection.remove Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/formattingstylecollection/remove-method/llms-full.txt)
- **Next:** [Javascript: FormField.getDescriptiveText Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/formfield/getdescriptivetext-method/llms-full.txt)
