identical
Validates that a field's value is equal to another field's value (or a fixed string).
Options
| Option | Type | Default | Description |
|---|---|---|---|
compare | string | required | Field name to compare against, or a fixed value |
trim | boolean | false | Trim whitespace from both values before comparing |
message | string | locale default | Custom error message |
Playground
Valid values
| Value | Notes |
|---|---|
Same as the password field | Values match |
Invalid values
| Value | Reason |
|---|---|
Different from the password field | Values do not match |
Notes
- Empty string (
"") always returnsvalid: true— validators only run on non-empty values. Combine withnotEmptyif the field is required. comparecan be a field name (resolved at validation time) or a fixed string literal.