# RequestSelectionFormFieldCallback Function

> Callback function for requesting a SelectionFormField.

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

---

### Description

Callback function for requesting a SelectionFormField.

### Syntax

```javascript
function(<SelectionFormField> selectionFormField)
```

### Examples

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

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

function requestSelectionFormFieldCallback(selectionFormField) {
    console.log("selection form field:", selectionFormField);
}

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

---

## Nearby

- **Previous:** [RequestSelectionBoundsCallback Function](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/requestselectionboundscallback/llms-full.txt)
- **Next:** [RequestSignatureFieldCallback Function](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/requestsignaturefieldcallback/llms-full.txt)
