Form validation made simple (wip)
npm i -S bubo
import Bubo from 'bubo';
const form = document.querySelector('.my-form');
const buboForm = new Bubo(form);
buboForm.validate();
Bubo form validation is (mainly) based on HTML5 form markup:
- supported attributes are:
required
,min
,max
,minlength
,maxlength
,pattern
- supported types are:
date
,email
,number
,tel
,url
Returns a Bubo instance
Validate the form.
You can access status
, text
and errors
properties…
Useful when the form content change. Re-initialize Bubo's validation rules.
Self-explained method…
Type: Object
inputNameAttribute: [arrayOfErrors]
Type: String
success or error
Type: String
"status text" aka global message for success/error