Questions when using multiStep form with dynamic steps/pages
Hi,
I am creating a multi-step form with dynamic steps/pages and facing some problems.
Here is the simplify code. https://stackblitz.com/edit/react-kw8ntc
The scenario of my case is
- Fill
Reference No., - Check
Step 3, then clickNext - Fill all fields, then click
Previous - Uncheck
Step 3, checkStep 4, then clickNext - Fill all fields, and click
Submit.
The form cannot be submitted. I think it keeps Step 3 error status.
I tried to remove the statuses by using setValue, setTouched, setError but it seems not working.
My questions are:
- Is it a correct way to reset status(values and errors) for specific fields?
- Is there any simple way to remove the whole (step/page)'s values?
- Is there any way to set
keepStateto theStep/Pageinstead of fields? - What is the purpose of setting
stepon the field?
Sorry to bother you with so many questions, but thank you for your patience.
So first your not using the step field correctly. The step field should be a static number that lets informed know what step that field is on. That was it knows if it needs to validate the field
Also the use case is interesting. Its basically dynamic steps. I need to look into this and build an example.
So first your not using the step field correctly. The step field should be a static number that lets informed know what step that field is on. That was it knows if it needs to validate the field
I see...
Also the use case is interesting. Its basically dynamic steps. I need to look into this and build an example.
Thanks. I will wait for your example.
Ok so I got you! I have refactored and added some cool shit! Stand by for another 20 minutes and I will update the docs!
Done! https://joepuzzo.github.io/informed/?path=/story/multistep-forms--complex-multistep
Thank you so much and I will give it a try tomorrow :))
Finally, I implemented this approach into my project and it works pretty well.
I really like the setCurrent function, it's so handy with my step navigation menu.
Thank you so much.
Glad I could help!
Done! https://joepuzzo.github.io/informed/?path=/story/multistep-forms--complex-multistep
Is this functionality still available I get redirected whenever I use the link.