Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditional fields validation and default values #451

Open
TheBous opened this issue Jul 22, 2024 · 2 comments
Open

Conditional fields validation and default values #451

TheBous opened this issue Jul 22, 2024 · 2 comments
Labels
bug Something isn't working question Further information is requested

Comments

@TheBous
Copy link

TheBous commented Jul 22, 2024

I'm facing a similar situation (#282) and I have a dropdown field that controls other inputs type string values that have their own default values, their own validators and constraints.
For example: I have a dropdown with 2 values: rectangle, circle.
When I enable square value from the dropdown, 2 other inputs type string appears on HTML: width and height. Width with default value of 10 and height with default value of 20, bot with min 5 and max 100.
If I choose circle from the dropdown, only 1 input appears on HTML: radius with the default value of 15, min 1 and max 100.
How can i solve this ?

@TheBous TheBous added the bug Something isn't working label Jul 22, 2024
@TheBous
Copy link
Author

TheBous commented Jul 23, 2024

@ciscoheat
Copy link
Owner

Can you please remake the example in Superforms v2 instead of version 1? Here's an updated test project: https://sveltelab.dev/github.com/ciscoheat/superforms-examples/tree/zod

@ciscoheat ciscoheat added the question Further information is requested label Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants