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

max

Table of contents

Description:

This key defines the maximum numerical value CloudCannon will allow in an Input.

When configured, CloudCannon will prevent you from entering a greater numerical value.

If the Input already contains a greater numerical value, CloudCannon will require you to enter a valid value to save your changes, or discard your unsaved changes.

This key is required for range inputs.

Value can be any integer.

If options.min is also configured, this key cannot be a lesser number.

This key has no default.

This key is available for Number Inputs.

Appears in:
└── _inputs
    └── *
        ├── Number Input
        │   └── options
        │       └── max
        └── Range Input
            └── options
                └── max
Type:
number
Examples:

In this example, we want to add a rating out of five for each article in our travel blog using the rating Input. This Input limits you to a maximum rating of five.

Copied to clipboard
_inputs:
  rating:
    type: number
    comment: How highly did you rate this experience?
    options:
      max: 5
      min: 1
{
  "_inputs": {
    "rating": {
      "type": "number",
      "comment": "How highly did you rate this experience?",
      "options": {
        "max": 5,
        "min": 1
      }
    }
  }
}
Open in a new tab