# Javascript: SelectionFormField.getItems Method

> Gets a list of items for the SelectionFormField. An item must not be an empty string.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > Javascript: SelectionFormField.getItems Method
- **339 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/selectionformfield/getitems-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/selectionformfield/getitems-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/selectionformfield/getitems-method/llms-full.txt

---

### Description

Gets a list of items for the SelectionFormField. An item must not be an empty string.

### Syntax

```javascript
<void> SelectionFormField.getItems(<RequestStringsCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Receives the index of the selected item. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `SelectionFormField.getItems` in a practical document-editing workflow. It gets a list of items for the SelectionFormField. An item must not be an empty string.

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

function inspectItems(selectionFormField) {
    selectionFormField.getItems(
        function(result) {
            console.log("get items result:", result);
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [Javascript: SelectionFormField.getIsDropDownArrowVisible Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/selectionformfield/getisdropdownarrowvisible-method/llms-full.txt)
- **Next:** [Javascript: SelectionFormField.getSelectedIndex Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/selectionformfield/getselectedindex-method/llms-full.txt)
