If an is thrown from an async validator the argument passed to the rejection handler will be that error.This allows you to differentiate from coding errors and validation errors.The attributes must be a plain object or a form element, things like backbone models etc are not supported.For the format of the constraints see the constraints section.They are meant to give a feeling for how to use the library and should not be considered production ready code.The native HTML form validate has been disabled in a demo purpose so that you may see how works in action.This differs from example Ruby on Rails where validators instead have the option.I find it quite common that you want to have constraints on an optional attribute.
There are no required external dependencies at all!
Unless otherwise specified you can always specify the message option to customize the message returned if the validator doesn't pass.
Just remember to not include the attribute name since it's automatically prepended to the error message.
The implementation is fairly basic and doesn't do anything clever with the messages.
It doesn't support things like only validating a sub key if the parent key is present so for more advanced validations multiple validation schemas are recommended. Most validators allow you to specify default messages in addition to default options, refer to the documentation for the individual validators for information on how to do this.