gte
| Category | Comparison |
| Related | gt · lt · lte |
| Bundle size | 293 B |
Validates that the value's size is greater than or equal to another element's size.
Usage
vue
<VfText name="min_guests" label="Min guests" rules="numeric" />
<VfText name="max_guests" label="Max guests" rules="numeric|gte:min_guests" />vue
<template>
<VfText name="min_guests" label="Min guests" rules="numeric" />
<VfText name="max_guests" label="Max guests" rules="numeric|gte:min_guests" />
</template>ts
{
min_guests: {
type: 'text',
label: 'Min guests',
rules: 'numeric',
},
max_guests: {
type: 'text',
label: 'Max guests',
rules: 'numeric|gte:min_guests',
},
}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_gte_string_error | The {attribute} must be greater than or equal {value} characters. |
rule_gte_numeric_error | The {attribute} must be greater than or equal {value}. |
rule_gte_array_error | The {attribute} must have {value} items or more. |
rule_gte_file_error | The {attribute} must be greater than or equal {value} kilobytes. |