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 Dependency failing #770

Open
DavidColemanUK opened this issue Mar 1, 2022 · 0 comments
Open

Conditional Dependency failing #770

DavidColemanUK opened this issue Mar 1, 2022 · 0 comments

Comments

@DavidColemanUK
Copy link

I'm updating a form, trying to get conditional dependencies working, within sub arrays/containers. Is this possible in Alpaca?
Any advice would be much appreciated.

Here's a JSFiddle and below is my example code.
I only want the Hospital (other) to show if the option hospital/320789 is chosen.

$(".field").alpaca({ "schema": { "type": "object", "title": "Test Form with conditionals in containers", "required": [], "properties": { "~0": { "type": "object", "properties": { "~1": { "type": "object", "properties": { "hfrsHDC": { "id": "conditionalTest", "type": "string", "title": "Please select an option", "options": [{ "value": 320789, "id": "hospital" }, { "value": 320790, "id": "community" } ], "enum": [ "320789", "320790" ] } } }, "~8": { "type": "object", "title": "Hospital details", "required": [], "properties": { "hospitalOther": { "type": "string", "title": "Hospital (Other)" }, } } } } } }, "options": { "fields": { "~0": { "fields": { "~8": { "fields": { "hospitalOther": { "dependencies": { //"#conditionalTest": [320789] "~0_~1_hfrsHDC": [320789] } }, //"dependencies": { // "#conditionalTest": "320789" // } } } } } }, } });

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

1 participant