# forms.validateRequired

Part of [Forms](https://kernstra.com/docs/web-sdk/config/forms) in the Kernstra Web SDK 1.0.0 configuration reference.

- Type: `boolean`
- Default: `false`
- Page: https://kernstra.com/docs/web-sdk/config/forms/validaterequired

Hold back Download while a required field is empty. The toolbar's Download (with or without your `onDownload`) does nothing while a required text, choice, check box or radio field is empty: a message names up to three empty fields (by their field names), then a count, and focus moves to the first. Read-only and hidden fields are skipped, and a check box or radio group counts as filled once any of its widgets is on. Signature fields are not checked. [`viewer.createExporter()`](https://kernstra.com/docs/web-sdk/api/pdfviewer/createexporter) is not held back; gate it yourself with [`doc.forms.getValues()`](https://kernstra.com/docs/web-sdk/api/doc-forms/getvalues), which carries the live input, and the fields.

```ts
import type { FormValue } from '@kernstra/pdf-web-sdk';

// One value per field; a check box or radio group reports 'Off' when nothing is on.
const values = await doc.forms.getValues();
const blank = (value: FormValue | undefined): boolean => {
  if (value === undefined || value === 'Off') return true;
  return typeof value === 'string' ? value.trim() === '' : value.length === 0;
};
const empty = new Set(
  (await doc.forms.fields())
    .filter((field) => field.required && !field.readOnly && blank(values[field.name]))
    .map((field) => field.name),
);
```

Web page: https://kernstra.com/docs/web-sdk/config/forms/validaterequired
