☁️ Loving our new documentation website? Provide feedback in the CloudCannon Community! ✨

Query String

Table of contents

Description:

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 String
Type:
string
Examples:

In this example, we have configured an input to be disabled when the published input 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 published input 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"
    }
  }
}
Open in a new tab