# Javascript: TextViewGeneratorColors.getFormFieldColor Method

> Gets the default highlight color of form fields. If the property is not set, the return value is null.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: TextViewGeneratorColors.getFormFieldColor Method
- **321 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/textviewgeneratorcolors/getformfieldcolor-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/textviewgeneratorcolors/getformfieldcolor-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/textviewgeneratorcolors/getformfieldcolor-method/llms-full.txt

---

### Description

Gets the default highlight color of form fields. If the property is not set, the return value is null.

### Syntax

```javascript
<void> TextViewGeneratorColors.getFormFieldColor(<RequestStringCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Receives the highlight color. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `TextViewGeneratorColors.getFormFieldColor` in a practical document-editing workflow. It gets the default highlight color of form fields. If the property is not set, the return value is null.

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

TXTextControl.displayColors.getFormFieldColor(
    function(result) {
        console.log("get form field color result:", result);
    },
    onTxError
);
```

---

## Nearby

- **Previous:** [Javascript: TextViewGeneratorColors.getDesktopColor Method](https://docs.textcontrol.com/ds-server/reference/javascript/textviewgeneratorcolors/getdesktopcolor-method/llms-full.txt)
- **Next:** [Javascript: TextViewGeneratorColors.getHeaderFooterLabelColor Method](https://docs.textcontrol.com/ds-server/reference/javascript/textviewgeneratorcolors/getheaderfooterlabelcolor-method/llms-full.txt)
