lte
| Category | Comparison |
| Related | lt · gt · gte |
| Bundle size | 292 B |
Validates that the value's size is less than or equal to another element's size.
Usage
vue
<VfText name="capacity" label="Capacity" rules="numeric" />
<VfText name="attendees" label="Attendees" rules="numeric|lte:capacity" />vue
<template>
<VfText name="capacity" label="Capacity" rules="numeric" />
<VfText name="attendees" label="Attendees" rules="numeric|lte:capacity" />
</template>ts
{
capacity: {
type: 'text',
label: 'Capacity',
rules: 'numeric',
},
attendees: {
type: 'text',
label: 'Attendees',
rules: 'numeric|lte:capacity',
},
}Parameters
| Parameter | Description |
|---|---|
other | The path of the element to compare against — see Referencing Other Elements. |
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
While the referenced element is empty and not yet validated, the rule passes — the comparison only kicks in once the other element has been validated or the form is submitted.
Error Messages
| Key | Default Message |
|---|---|
rule_lte_string_error | The {attribute} must be less than or equal {value} characters. |
rule_lte_numeric_error | The {attribute} must be less than or equal {value}. |
rule_lte_array_error | The {attribute} must not have more than {value} items. |
rule_lte_file_error | The {attribute} must be less than or equal {value} kilobytes. |