# isValid

> This document is the Markdown version of [formisch.dev/methods/api/isValid/](https://formisch.dev/methods/api/isValid/). For the complete documentation index, see [llms.txt](https://formisch.dev/llms.txt).

Checks whether a specific field or the entire form is valid by walking through the field store and all its descendants. A field is valid when neither it nor any of its descendants contains an error.

```ts
const valid = isValid<TSchema>(form);
const valid = isValid<TSchema, TFieldPath>(form, config);
```

## Generics

- `TSchema` `extends FormSchema`
- `TFieldPath` `extends RequiredPath | undefined = undefined`

## Parameters

- `form` `BaseFormStore<TSchema>`
- `config` `IsFormValidConfig | IsFieldValidConfig<TSchema, TFieldPath> | undefined`

### Explanation

The `form` parameter is the form store to check for validity. The optional `config` parameter scopes the check to a specific field's subtree via a `path` (when omitted, the entire form is checked). The function walks through the field store and all its descendants and returns `false` as soon as it finds an error.

## Returns

- `result` `boolean`

## Related

### Primitives

[`useForm`](/react/api/useForm.md)

### Methods

[`getErrors`](/methods/api/getErrors.md), [`getDeepErrors`](/methods/api/getDeepErrors.md), [`isDirty`](/methods/api/isDirty.md), [`isTouched`](/methods/api/isTouched.md), [`isEdited`](/methods/api/isEdited.md)
