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

visible-if required-if #151

Closed
kaihendry opened this issue Apr 20, 2016 · 2 comments
Closed

visible-if required-if #151

kaihendry opened this issue Apr 20, 2016 · 2 comments

Comments

@kaihendry
Copy link

Apologies in advance, perhaps this a JSON schema question or my mis-understanding, but I am little confused to how one handles more complex forms in the sense if say an applicant is under 16, a guardian form is then required.

Can that be described in JSON schema, or is that some tweak I can make with react-jsonschema-form?

I can see from http://stackoverflow.com/a/11652478/4534 that you can make things required-if but not visible-if.

@n1k0
Copy link
Collaborator

n1k0 commented Apr 20, 2016

That would probably require support for oneOf (#52) and possibly supplementary shenanigans for handling conditionals.

Your best bet for now would be to write your own custom field I think.

@n1k0 n1k0 closed this as completed Apr 20, 2016
@kaihendry
Copy link
Author

Could you please give an example of conditional form as a custom field?

I've been staring at https://github.com/mozilla-services/react-jsonschema-form#custom-field-components and not quite getting it. Should I create separate forms that show only if I can detect certain formData exists in another form?

James-Brown98 pushed a commit to James-Brown98/react-jsonschema-form that referenced this issue Feb 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants