TX Text Control .NET Server

Javascript: Forms.validate Method

Method|Introduced in 29.0

Description

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

Syntax

<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.

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