# Javascript: FormattedText.formFields Property

> Gets a collection of all form fields in the text part.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 30.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: FormattedText.formFields Property
- **233 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/formattedtext/formfields-property/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/formattedtext/formfields-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/formattedtext/formfields-property/llms-full.txt

---

### Description

Gets a collection of all form fields in the text part.

### Syntax

```javascript
<FormFieldCollection> FormattedText.formFields
```

### Examples

The following example demonstrates `FormattedText.formFields` in a practical document-editing workflow. It gets a collection of all form fields in the text part.

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

TXTextControl.textParts.getMainText(function(formattedText) {
    formattedText.formFields.getCount(function(count) {
        console.log("form fields count:", count);
    }, onTxError);
}, onTxError);
```

---

## Nearby

- **Previous:** [Javascript: FormattedText.find Method](https://docs.textcontrol.com/ds-server/reference/javascript/formattedtext/find-method/llms-full.txt)
- **Next:** [Javascript: FormattedText.frames Property](https://docs.textcontrol.com/ds-server/reference/javascript/formattedtext/frames-property/llms-full.txt)
