willy-validation
v1.1.15
Published
Validatie script
Downloads
32
Readme
Validatie
Form validatie script als uitbreiding op https://validatejs.org/
Installatie
npm install willy-validation --save
yarn add willy-validation
Implementatie voorbeeld
import Validate, { ValidationOptions } from 'willy-validation';
const opts: ValidationOptions = {
validateOnBlur: false
};
const v = new Validate(document.querySelector('form'), opts);
v.validate();
Opties
customLabels
Standaard worden labels automatisch opgebouwd, maar deze zijn te overrulen
customLabels: { original: new }
Default: null
extendedConstraints
Constraints worden automatisch gebouwd, soms wil je deze extenden / overwriten. https://validatejs.org/#constraints
extendedConstraints: {
'fieldname': {
presence: true
}
}
Default: null
locale
Custom locale. Beschikbare locales:
- en
- nl
Default: 'en'
validateOnBlur
Moet elk veld gevalideerd worden bij een blur?
Default: true