# Javascript: Forms.validate Method

> Validates all current form fields and scrolls to the first invalid field.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 29.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API - Document Viewer > Javascript: Forms.validate Method
- **194 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript-document-viewer/forms/validate-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript-document-viewer/forms/validate-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript-document-viewer/forms/validate-method/llms-full.txt

---

### Description

Validates all current form fields and scrolls to the first invalid field.

### Syntax

```javascript
<boolean> Forms.validate()
```

### Return Value

Validates all current form fields and scrolls to the first invalid field.

### Examples

The following example demonstrates `forms.validate` in a practical Document Viewer workflow. Validates the form fields and returns true, in case all required fields are completed and false, in case fields are missing.

```javascript
const formIsComplete = TXDocumentViewer.forms.validate();
if (!formIsComplete) {
    TXDocumentViewer.forms.showFormsBar(true);
    console.warn("Complete all required form fields before continuing.");
}
```

---

## Nearby

- **Previous:** [Javascript: Forms.showFormsBar Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript-document-viewer/forms/showformsbar-method/llms-full.txt)
- **Next:** [HypertextLinkClickedEventArgs Object](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript-document-viewer/hypertextlinkclickedeventargs/llms-full.txt)
