How to set isSubmitted
to false
after each submission in a multistep form?
#10973
Unanswered
ShahriarKh
asked this question in
Q&A
Replies: 1 comment 4 replies
-
Try passing your current step values + the default values of the other steps to the first const { reset, getValues } = useForm()
reset({ ...getValues(), step2Field1: "" }) |
Beta Was this translation helpful? Give feedback.
4 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.
Uh oh!
There was an error while loading. Please reload this page.
-
How can I change the value of isSubmitted for multistep forms?
I'm trying to change the appearance of inputs (show red border for invalid and green border for valid inputs) based on the state of form, but since the form is multistep, the
isSubmitted
remains true after first step.Is there a way to reset it? I tried
methods.reset({}, { keepValues: true });
but no luck.Per docs:
codesandbox: https://codesandbox.io/s/optimistic-kate-9kjx9d?file=/src/App.js
Beta Was this translation helpful? Give feedback.
All reactions