Replies: 1 comment 1 reply
-
When you want the real time validation to happen submit the form with a flag (ex. hidden input) which instructs the action handler to do only the validation part of the form handling. When you actually submit the form, just remove the flag. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I am currently using remix. When I submit the form, the server side validates it and then sends back the error messages to display to the user. I use
safeParseForm()
which allows me to send back a json like this:And I can use the validationIssues in the front end like this:
However, I want to do real time validation without submitting the form. Hence, I use
validator.validate()
on the client side to manually control the form. Something like this:My question is, how do I get the
validationIssues
usingvalidator.validate()
similar tosafeParseForm()
?Beta Was this translation helpful? Give feedback.
All reactions