- Description:
This key represents a query string value for the
disabledkey 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 String- Type:
string- Examples:
In this example, we have configured an input to be disabled when the
publishedinput is truthy.Copied to clipboard_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
publishedinput is falsy using the!prefix.Copied to clipboard_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" } } }