max
Validates that the value's size does not exceed a maximum.
Usage
vue
<VfText name="username" label="Username" rules="max:16" />vue
<template>
<VfText name="username" label="Username" rules="max:16" />
</template>ts
{
username: {
type: 'text',
label: 'Username',
rules: 'max:16',
},
}Parameters
| Parameter | Description |
|---|---|
max | The maximum size. |
Behavior
How size is measured depends on the element type:
- String — the character count
- Numeric — the numeric value itself
- Array — the number of items
- File — the file size in kilobytes
Error Messages
| Key | Default Message |
|---|---|
rule_max_string_error | The {attribute} may not be greater than {max} characters. |
rule_max_numeric_error | The {attribute} may not be greater than {max}. |
rule_max_array_error | The {attribute} may not have more than {max} items. |
rule_max_file_error | The {attribute} may not be greater than {max} kilobytes. |