A lightweight
validation library
for javascript

Documentation

Fields

value: This field is required

fieldName: This field is required

message: This field is optional. If you wanna use custom messages use this.

Full example

Required

validations: [{type: 'required'}]

Min

validations: [{type: 'min|5'}]

Max

validations: [{type: 'max|15'}]

Between

validations: [{type: 'between|5-15'}]

Type

validations: [{type: 'email'}]   number

Custom Regex

validations: [{type: 'customRegex|^\\d+$'}]

Starts With

validations: [{type: 'startsWith|a'}]

Ends With

validations: [{type: 'endsWith|z'}]