json-editor
json-editor copied to clipboard
Is it possible to show a part of the form only if a checkbox is checked?
If I have something like this:
{
"title": "Person",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "First and Last name",
"minLength": 4,
"default": "Jeremy Dorn"
},
"has_pets": {
"type": "boolean",
"format": "checkbox",
"title": "Has Pets?"
},
"pets": {
"type": "array",
"format": "table",
"title": "Pets",
"uniqueItems": true,
"items": {
"type": "object",
"title": "Pet",
"properties": {
"type": {
"type": "string",
"enum": [
"cat",
"dog",
"bird",
"reptile",
"other"
],
"default": "dog"
},
"name": {
"type": "string"
}
}
},
"default": [
{
"type": "dog",
"name": "Walter"
}
]
}
}
}
How can I make the pets object appear ONLY if has_pets is true? Ideally, the JSON for pets would also be exported only if the condition is true.
Also curious about this, as it seems to be the only missing feature. This is possible in jsonform.
+1
+1
+1
+1
+1 Is there any solution for this?