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

[Docs] Guide about dynamic forms & nested fields #481

Open
juliendelort opened this issue Oct 18, 2023 · 2 comments
Open

[Docs] Guide about dynamic forms & nested fields #481

juliendelort opened this issue Oct 18, 2023 · 2 comments

Comments

@juliendelort
Copy link
Contributor

A common use case with forms is showing or hiding fields based on other field’s values. For example, a “select a reason” form that has an “other” checkbox that shows an extra textarea (”please specify”) when checked.

Nested fields should be covered as well: For example, if a specific field is of type string[] and I need to have an input for each entry (and a “add item” button that adds a new input), how should I handle it? Do I need a data transformation layer?

More about nested fields: https://informel.site/nested_fields

@crutchcorn
Copy link
Member

crutchcorn commented Oct 18, 2023

Love this, yeah. We support this today using the index field, but we also could use some more tests to validate this functionality as well.

For anyone working on these docs, be aware that this functionality may change before v1.0. Not a blocker for documenting, just that it may need updating in the future

@KGSands
Copy link

KGSands commented Jan 10, 2025

This might not be the right thread but I'd be interested knowing how to handle validation for nested fields e.g. in the case that "other" is selected here, that the textarea ("specify reason") is required, but in the case that "other" is not selected, that the validation does not affect it (as it is presumably empty).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants