Behavior difference between form.validate() and basic client-side validation
#1109
-
|
I encountered a difference between
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Hi @WataruNishimura, The validate intent supports both form and field level validation. When you call |
Beta Was this translation helpful? Give feedback.
Hi @WataruNishimura,
The validate intent supports both form and field level validation. When you call
form.validate(), it marks every field in the form touched. So any errors in the result will be shown directly. This is similar to clicking on an submit button, except that no submission will be made. If you callform.validate(name)instead, it marks only that field as touched, and only touched fields with errors would be shown. This is also what Conform uses internally when you haveshouldValidateorshouldRevalidateconfigured.