-
Notifications
You must be signed in to change notification settings - Fork 364
Description
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" // } } } } } }, } });