Description
Reads and validates form fields and controls form-field interaction.
Examples
The following example demonstrates Forms in a practical Document Viewer workflow. This object provides functionalities for working with forms and form fields.
const formIsComplete = TXDocumentViewer.forms.validate();
const formValues = TXDocumentViewer.forms.getValues();
console.log({ formIsComplete, formValues });
Members
Properties
| Property | Description |
|---|
| Events | Form event names accepted by addEventListener(). |
Methods
| Method | Description |
|---|
| activate | Enables form-field interaction. |
| addEventListener | Adds a DOM event listener to every current form field. |
| deactivate | Disables form-field interaction. |
| getValues | Returns the current value, name, type, and identifier of each form field. |
| removeEventListener | Removes a DOM event listener from every current form field. |
| showFormsBar | Shows or hides the form navigation bar. If no form bar is available, no action is taken. |
| validate | Validates all current form fields and scrolls to the first invalid field. |
Enumerations
| Enumeration | Description |
|---|
| Events | Names of DOM events raised by form fields. |