# Javascript: TextPart.addTextField Method

> Obsolete. This method will be removed in one of the next versions. Inserts a new ApplicationField or TextField into the TextPart at the current input position.

> **Note:** This is deprecated and should not be used in new work.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 25.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > Javascript: TextPart.addTextField Method
- **325 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/textpart/addtextfield-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/textpart/addtextfield-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/textpart/addtextfield-method/llms-full.txt

---

### Description

`Obsolete. This method will be removed in one of the next versions.` Inserts a new ApplicationField or TextField into the TextPart at the current input position.

### Syntax

```javascript
<void> TextPart.addTextField(<TextField> textField)
```

### Parameters

| Parameter | Description |
|---|---|
| textField | To insert textfield. |

### Examples

The following example demonstrates `TextPart.addTextField` in a practical document-editing workflow. Obsolete. This method will be removed in one of the next versions. Inserts a new ApplicationField or TextField into the TextPart at the current input position.

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

function addTextField(textField) {
    TXTextControl.textParts.getMainText(function(textPart) {
        textPart.addTextField(textField);
    }, onTxError);
}
```

---

## Nearby

- **Previous:** [Javascript: TextPart.addSubTextPart Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/textpart/addsubtextpart-method/llms-full.txt)
- **Next:** [Javascript: TextPart.getSubTextParts Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/textpart/getsubtextparts-method/llms-full.txt)
