You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/Validation.md
+16
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,22 @@ React-admin relies on [react-hook-form](https://react-hook-form.com/) for the va
14
14
15
15
You can’t use both form level validation and input level validation - this is a `react-hook-form` limitation.
16
16
17
+
## Validation Mode
18
+
19
+
By default, the validation mode is `onSubmit`, and the re-validation mode is `onChange`.
20
+
21
+
Since [`<Form>`](./Form.md) actually passes all additional props to react-hook-form's [`useForm` hook](https://react-hook-form.com/api/useform/), this can easily be changed by setting the `mode` and `reValidateMode` props.
The value of the form `validate` prop must be a function taking the record as input, and returning an object with error messages indexed by field. For instance:
0 commit comments