# TextFormField Object

> 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.

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

---

### 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

```javascript
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.

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

---

## In This Section

- [Javascript: TextFormField.getEmptyWidth Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/textformfield/getemptywidth-method/llms-full.txt): Gets the horizontal extension, in twips, of the text formfield, when it is empty.
- [Javascript: TextFormField.setEmptyWidth Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/textformfield/setemptywidth-method/llms-full.txt): Sets the horizontal extension, in twips, of the text formfield, when it is empty.

---

## Nearby

- **Previous:** [Javascript: TextFieldInfo.type Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/textfieldinfo/type-property/llms-full.txt)
- **Next:** [Javascript: TextFormField.getEmptyWidth Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/textformfield/getemptywidth-method/llms-full.txt)
