required

On this page

Description:

This key toggles whether CloudCannon requires this Input to have a value.

Setting this key to true will require you to enter a value to save your changes, or discard your unsaved changes.

By default, this key is false (i.e., CloudCannon does not require this Input to have a value).

This key is available for Array, Code, Color, Date and Time, File, Number, Object, Select and Multiselect, Text, Rich Text, and URL Inputs.

Appears in:
├── Text Input
│   └── options
│       └── required
├── _inputs
│   └── *
│       ├── Textarea Input
│       │   └── options
│       │       └── required
│       ├── Code Input
│       │   └── options
│       │       └── required
│       ├── Color Input
│       │   └── options
│       │       └── required
│       ├── Number Input
│       │   └── options
│       │       └── required
│       ├── Range Input
│       │   └── options
│       │       └── required
│       ├── Rich Text Input
│       │   └── options
│       │       └── required
│       ├── Date/Datetime Input
│       │   └── options
│       │       └── required
│       ├── Time Input
│       │   └── options
│       │       └── required
│       ├── File Input
│       │   └── options
│       │       └── required
│       ├── Multiselect Input
│       │   └── options
│       │       └── required
│       ├── Choice Input
│       │   └── options
│       │       └── required
│       ├── Multichoice Input
│       │   └── options
│       │       └── required
│       ├── Object Input
│       │   └── options
│       │       └── required
│       └── Array Input
│           └── options
│               └── required
├── URL Input
│   └── options
│       └── required
└── Select Input
    └── options
        └── required
Type:
boolean
Default value:
false
Examples:

In this example, we want to require our team to enter an author value for markup files with this Input.

Copied to clipboard
_inputs:
  author:
    type: text
    comment: Enter the name of the author for this blog post.
    options:
      required: true
{
  "_inputs": {
    "author": {
      "type": "text",
      "comment": "Enter the name of the author for this blog post.",
      "options": {
        "required": true
      }
    }
  }
}
Open in a new tab