String values for this key are deprecated. Use disabled_if instead.
This key represents a query string value for the disabled key that conditionally prevents editing of an input value based on another input's value.
The value is a string that references a sibling input key name. CloudCannon evaluates the referenced input's value to determine whether to disable this input.
When the referenced input is truthy, CloudCannon disables this input. You can reverse this behavior by prefixing the string with !.
For reverse values in YAML files, the string should be wrapped in single or double quotation marks.
Appears in#
└── disabled
└── Query StringType#
string Deprecated
Examples#
In this example, we have configured an input to be disabled when the published input is truthy.
_inputs:
published:
type: checkbox
label: Published
edit_date:
type: datetime
label: Last edited
disabled: published{
"_inputs": {
"published": {
"type": "checkbox",
"label": "Published"
},
"edit_date": {
"type": "datetime",
"label": "Last edited",
"disabled": "published"
}
}
}In this example, we have configured an input to be disabled when the published input is falsy using the ! prefix.
_inputs:
published:
type: checkbox
label: Published
draft_notes:
type: textarea
label: Draft notes
disabled: '!published'{
"_inputs": {
"published": {
"type": "checkbox",
"label": "Published"
},
"draft_notes": {
"type": "textarea",
"label": "Draft notes",
"disabled": "!published"
}
}
}