lt
| Category | Comparison |
| Related | lte · gt · gte |
| Bundle size | 290 B |
Validates that the value's size is less than another element's size.
Usage
vue
<VfText name="budget" label="Budget" rules="numeric" />
<VfText name="spent" label="Spent" rules="numeric|lt:budget" />vue
<template>
<VfText name="budget" label="Budget" rules="numeric" />
<VfText name="spent" label="Spent" rules="numeric|lt:budget" />
</template>ts
{
budget: {
type: 'text',
label: 'Budget',
rules: 'numeric',
},
spent: {
type: 'text',
label: 'Spent',
rules: 'numeric|lt:budget',
},
}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_lt_string_error | The {attribute} must be less than {value} characters. |
rule_lt_numeric_error | The {attribute} must be less than {value}. |
rule_lt_array_error | The {attribute} must have less than {value} items. |
rule_lt_file_error | The {attribute} must be less than {value} kilobytes. |