- Description:
This key defines options that are specific to Range Inputs.
- Appears in:
└── _inputs └── * └── Range Input └── options- Type:
Object- Properties:
This key defines how an 'empty' value will be saved. Does not apply to existing empty values.
Defaults to:
nullAllowed values:
nullnumberShow examplesHide examples
In this example, we have configured how empty number values will be saved.
Copied to clipboard_inputs: quantity: type: number options: empty_type: number{ "_inputs": { "quantity": { "type": "number", "options": { "empty_type": "number" } } } }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
rangeinputs.Value can be any integer.
If
options.minis also configured, this key cannot be a lesser number.This key has no default.
This key is available for Number Inputs.
Show examplesHide examples
In this example, we want to add a rating out of five for each article in our travel blog using the
ratingInput. 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 } } } }This key defines a custom error message that explains why a value has failed the validation criteria from
options.max. This key requires you to defineoptions.max.This key has no default.
This key is available for Number Inputs.
Show examplesHide examples
In this example, we prompt our team to enter a valid number using a custom message.
Copied to clipboard_inputs: rating: type: number comment: How highly did you rate this experience? options: max: 5 max_message: Cannot be more than 5 min: 1 min_message: Cannot be less than 1{ "_inputs": { "rating": { "type": "number", "comment": "How highly did you rate this experience?", "options": { "max": 5, "max_message": "Cannot be more than 5", "min": 1, "min_message": "Cannot be less than 1" } } } }This key defines the minimum numerical value CloudCannon will allow in an Input.
When configured, CloudCannon will prevent you from entering a lesser numerical value.
If the Input already contains a lesser 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
rangeinputs.Value can be any number.
If
options.maxis also configured, this key cannot be a greater number.This key has no default.
This key is available for Number Inputs.
Show examplesHide examples
In this example, we want to add a rating out of five for each article in our travel blog using the
ratingInput. This Input limits you to a minimum rating of one.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 } } } }This key defines a custom error message that explains why a value has failed the validation criteria from
options.min. This key requires you to defineoptions.min.This key has no default.
This key is available for Number Inputs.
Show examplesHide examples
In this example, we prompt our team to enter a valid number using a custom message.
Copied to clipboard_inputs: rating: type: number comment: How highly did you rate this experience? options: max: 5 max_message: Cannot be more than 5 min: 1 min_message: Cannot be less than 1{ "_inputs": { "rating": { "type": "number", "comment": "How highly did you rate this experience?", "options": { "max": 5, "max_message": "Cannot be more than 5", "min": 1, "min_message": "Cannot be less than 1" } } } }This key toggles whether CloudCannon requires this Input to have a value.
Setting this key to
truewill 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.
Defaults to:
falseShow examplesHide examples
In this example, we want to require our team to enter an
authorvalue 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 } } } }This key defines a custom error message that explains why a value has failed the validation criteria from
options.required.This key requires you to define
options.required.This key has no default.
This key is available for Array, Code, Color, Date and Time, File, Number, Object, Select and Multiselect, Text, Rich Text, and URL Inputs.
Show examplesHide examples
In this example, we prompt our team to use enter an Input value using a required message.
Copied to clipboard_inputs: author: type: text comment: Enter the name of the author for this blog post. options: required: true required_message: You are not allowed to leave this blank.{ "_inputs": { "author": { "type": "text", "comment": "Enter the name of the author for this blog post.", "options": { "required": true, "required_message": "You are not allowed to leave this blank." } } } }This key defines a number that specifies the granularity that the value must adhere to, or the special value any, which allows any decimal value between
maxandmin.Show examplesHide examples
In this example, we have configured a Range Input to use a step value of 5.
Copied to clipboard_inputs: rating: type: range options: min: 0 max: 100 step: 5{ "_inputs": { "rating": { "type": "range", "options": { "min": 0, "max": 100, "step": 5 } } } }- Examples: