nettools.jscore.validator.FormValidator (from package js-core/src/js-core.js)

One time validator (by contrast to real-time validator)

Params constructor parameter : { required : ['input1', 'input2', ...] regexps : {input1:/reg/, input2:/reg/, ...} onsubmit : callback(elements=form.elements) return {statut:true/false, message:"", field:input} onsubmitpromise = callback(elements[]) { return Promise.resolve({statut:true}) **OR** return Promise.reject({statut:false, message:'error', field:input}) } notifier : function({statut:true/false, message:'', field:input}) root : 'fForm' } When onsubmitpromise parameter is defined, the isValid() method will return a Promise object resolved or rejected depending on the Promise returned by onsubmitpromise callback (the resolve or reject calls must have an object litteral with statut, field, message properties).

Constructor

Properties

Methods

Details

Constructor

Methods