Good examples for password and repeat password validation #13133
Unanswered
binarykitchen
asked this question in
Q&A
Replies: 2 comments
|
Thanks @BrendanC23 I see. I'm just reluctant to use Zod or Yup for a small form as it feels like an overhead. Surprised react-hook-form alone cannot do this. |
0 replies
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.
Hello folks,
I'm stuck with a problem where a user enters the repeat password first and only then enters the password.
How can I trigger to revalidate the repeat password after the user has entered the first password?
If you look at this example
https://github.com/react-hook-form/react-hook-form/blob/master/examples/V7/getValuesCompareFields.tsx
It has one bug: when the new password has changed, it does not re-trigger the validation for the repeat password.
And putting the
triggerfunction inside a validation function will lead to a deadlock, it will loop forever and freezes the browser.Suggestions very welcome. Thanks :)
All reactions