How to validate before submit
As you can see, I have a form where I’ll be submitting a server action. I don’t want my submit button to be disabled (only when isSubmitting = true). However, when clicking the button, I’d first like to validate the form, and if isValid = false, I want to prevent the submit.
By the way, could you also take a look and let me know whether my form makes sense in general? Am I invoking the server action correctly?

1 Reply
fascinating-indigo•2mo ago
You could validate the fields using the onBlur validator for each field, that would then set the form to not isValid if there's an error. Or you could do form validation as well in the validator for the useAppForm