Skip to content

Commit 8697a86

Browse files
author
oxcom
committed
update readme
1 parent 070d2ec commit 8697a86

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,29 @@ form
3636
new Length({min: 6}),
3737
]);
3838

39-
const result = form.validate({
39+
const errors = form.validate({
4040
email: 'email@example.com',
4141
password: '1234567',
4242
});
4343

4444
// Object with list of invalid properties. Each property contains array of errors
45-
console.log(result);
45+
console.log(errors)
4646
```
47+
48+
In case of form data is not valid the ```errors``` object contains properties (related to from filed names) and array of [Error](https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Global_Objects/Error) objects.
49+
```javascript
50+
{
51+
'email': [
52+
Error,
53+
Error,
54+
],
55+
'password': [
56+
Error,
57+
]
58+
}
59+
```
60+
61+
4762
## Documentation
4863
- [Form](docs/Form.md) - form configuration
4964
- [Constraints](docs/Constraints.md) - list of supported constraints

0 commit comments

Comments
 (0)