Alpaca's dependency system hides the dependant field if the dependency is not met, otherwise the field is shown and any options assigned to it such as validation options are also required.
After looking through the documentation I noticed that you have to set the dependencies in both the schema and the options objects.
JSON
{
"view": "bootstrap-edit",
"schema": {
"type": "object",
"properties": {
"description_required": {
"enum": [
"Y",
"N"
],
"required": true
},
"description": {
"required": true
}
},
"dependencies": {
"description": ["description_required"] // Specify the field that your conditional field is dependant on
}
},
"options": {
"fields": {
"description_required": {
"type": "select",
"noneLabel": "Select an Option",
"label": "Description Required"
},
"description": {
"type": "textarea",
"cols": 5,
"label": "Description",
"dependencies": {
"description_required": "Y" // Specify the required value for the dependant field to show
}
}
}
}
}
In the above example, we have a simple select with the options of Y and N. If Y is selected then we show a required textarea, otherwise the textarea is not displayed.
Live Example
JSFiddle - Take note of the comments in the form object.