# RequestTextFormFieldCallback Function

> Callback function for requesting a TextFormField.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Function
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > RequestTextFormFieldCallback Function
- **282 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/requesttextformfieldcallback/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/requesttextformfieldcallback/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/requesttextformfieldcallback/llms-full.txt

---

### Description

Callback function for requesting a TextFormField.

### Syntax

```javascript
function(<TextFormField> textFormField)
```

### Examples

The following example demonstrates `RequestTextFormFieldCallback` in a practical document-editing workflow. Callback function for requesting a TextFormField.

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

function requestTextFormFieldCallback(textFormField) {
    console.log("text form field:", textFormField);
}

TXTextControl.textParts.getMainText(function(mainText) {
    const formFields = mainText.formFields;
    formFields.addTextFormField(1440, requestTextFormFieldCallback, onTxError);
}, onTxError);
```

---

## Nearby

- **Previous:** [RequestTextFieldsCallback Function](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/requesttextfieldscallback/llms-full.txt)
- **Next:** [RequestTextFrameCallback Function](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/requesttextframecallback/llms-full.txt)
