Composable & dynamic form validation #1049
Unanswered
roma-glushko
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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