Composable & dynamic form validation #1049
Unanswered
roma-glushko
asked this question in
Q&A
Replies: 1 comment
-
Sorry for the late replay. I have been very busy the last few days. Can you provide minimal sample code for example via our playground? |
Beta Was this translation helpful? Give feedback.
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey folks,
I would like to use valibot to power validation of a dynamic form.
Let's say we have a checkout form. The checkout form consists of:
Questions
The form is kinda complicated, so customer info, shipping methods & shipping address rendering, etc. might be organised as separate components. What's the best way to compose the checkout form validation in this case? Should I define a "global" form validation on the checkout component level and then pass Form/Field components down to the specific checkout subcomponents like shipping options?
Can I somehow change the valibot schema based on the currently selected shipping method, so it knows which address fields should be validated/required?
Would appreciate any references to similar examples or docs 🙏
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions