-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
74 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# Rules | ||
|
||
In this section, you can find the truth tables for all validation rules. | ||
|
||
:::tip | ||
You can learn more about the [Rule Terminology](/terminology.html#rule). | ||
::: | ||
|
||
## `accepted` | ||
|
||
The field under validation must be `yes`, `on`, `1` or `true`. This is useful for validating "Terms of Service" acceptance. | ||
|
||
| Definition | Value | Is valid? | | ||
| ---------- | ----------- | --------- | | ||
| `accepted` | `null` | π’ | | ||
| `accepted` | `undefined` | π’ | | ||
| `accepted` | `'yes'` | π’ | | ||
| `accepted` | `'on'` | π’ | | ||
| `accepted` | `1` | π’ | | ||
| `accepted` | `true` | π’ | | ||
| `accepted` | `john` | π΄ | | ||
| `accepted` | `3.14` | π΄ | | ||
|
||
## `after:date` | ||
|
||
The field under validation must be after the given date. | ||
|
||
| Definition | Value | Is valid? | | ||
| ------------------ | ------------ | --------- | | ||
| `after:2024-01-01` | `null` | π’ | | ||
| `after:2024-01-01` | `undefined` | π’ | | ||
| `after:2024-01-01` | `2025-01-01` | π’ | | ||
| `after:2024-01-01` | `2024-01-01` | π΄ | | ||
| `after:2024-01-01` | `2020-01-01` | π΄ | | ||
|
||
## `afterOrEqual:date` | ||
|
||
The field unter validation must be after or equal to the given field | ||
|
||
| Definition | Value | Is valid? | | ||
| ------------------ | ------------ | --------- | | ||
| `after:2024-01-01` | `null` | π’ | | ||
| `after:2024-01-01` | `undefined` | π’ | | ||
| `after:2024-01-01` | `2025-01-01` | π’ | | ||
| `after:2024-01-01` | `2024-01-01` | π’ | | ||
| `after:2024-01-01` | `2020-01-01` | π΄ | | ||
|
||
## `alpha` | ||
|
||
The field under validation must be entirely alphabetic characters. | ||
|
||
| Definition | Value | Is valid? | | ||
| ---------- | ----------- | --------- | | ||
| `alpha` | `null` | π’ | | ||
| `alpha` | `undefined` | π’ | | ||
| `alpha` | `john` | π’ | | ||
| `alpha` | `123` | π΄ | | ||
| `alpha` | `3.14` | π΄ | | ||
| `alpha` | `true` | π΄ | | ||
|
||
## `required` | ||
|
||
| Definition | Value | Is valid? | | ||
| ---------- | ----------- | --------- | | ||
| `required` | `null` | π΄ | | ||
| `required` | `undefined` | π΄ | | ||
| `required` | `''` | π΄ | | ||
| `required` | `john` | π’ | | ||
| `required` | `123` | π’ | | ||
| `required` | `1.23` | π’ | | ||
| `required` | `{}` | π’ | |