mirror of
https://github.com/cupcakearmy/formhero.git
synced 2024-12-23 00:26:23 +00:00
Update README.md
This commit is contained in:
parent
e3398b8571
commit
6b07497230
18
README.md
18
README.md
@ -189,3 +189,21 @@ const validators = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
###### Example: Multiple Validators
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const validators = {
|
||||||
|
username: [{
|
||||||
|
validator: /^[A-z]*$/,
|
||||||
|
message: 'My custom error message',
|
||||||
|
},
|
||||||
|
/[\d]/,
|
||||||
|
async (value) => value.length > 0,
|
||||||
|
{
|
||||||
|
validator: (value) => true,
|
||||||
|
message: 'Some other error',
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user