T
TanStack12mo ago
foreign-sapphire

canSubmit is true in onSubmit validator

I'm wondering why canSubmit is true when I choose onSubmit validation. Shouldn't be false because the form is not valid?
2 Replies
continuing-cyan
continuing-cyan12mo ago
Yes
other-emerald
other-emerald12mo ago
Using the onMount validator you can validate your form when it mounts and set it to invalid if needed - that way canSubmit will be false onSubmit runs after you submitted the form

Did you find this page helpful?