src/aria/utils/validators/MultipleValidator.js
function (value, groups, event) {
            var validators = this.validators;
            if (validators.length) {
                var res;
                var isMember = false;
                for (var i = 0; i < validators.length; i++) {
                    isMember = this.dataUtils.checkGroup(validators[i].groups, groups);
                    if (isMember && (this.dataUtils.checkEventToValidate(validators[i].eventToValidate, event))) {
                        var extraRes = validators[i].validate(value, groups, event);
                        if (extraRes && extraRes.length > 0) {
                            if (res == null) {
                                res = extraRes;
                            } else {
                                res = res.concat(extraRes);
                            }
                            if (this.breakOnMessage) {
                                break;
                            }
                        }
                    }
                }
                if (res && res.length > 0) {
                    if (this.groupMessages) {
                        var msgGroup = ariaUtilsJson.copy(this.message);
                        msgGroup.subMessages = res;
                        return [msgGroup];
                    } else {
                        return res;
                    }
                }
                return null;
            }
        }
function (value, groups, event) {
            var validators = this.validators;
            if (validators.length) {
                var res;
                var isMember = false;
                for (var i = 0; i < validators.length; i++) {
                    isMember = this.dataUtils.checkGroup(validators[i].groups, groups);
                    if (isMember && (this.dataUtils.checkEventToValidate(validators[i].eventToValidate, event))) {
                        var extraRes = validators[i].validate(value, groups, event);
                        if (extraRes && extraRes.length > 0) {
                            if (res == null) {
                                res = extraRes;
                            } else {
                                res = res.concat(extraRes);
                            }
                            if (this.breakOnMessage) {
                                break;
                            }
                        }
                    }
                }
                if (res && res.length > 0) {
                    if (this.groupMessages) {
                        var msgGroup = ariaUtilsJson.copy(this.message);
                        msgGroup.subMessages = res;
                        return [msgGroup];
                    } else {
                        return res;
                    }
                }
                return null;
            }
        }
function ( value , groups , event ) { var validators = this . validators ; if ( validators . length ) { var res ; var isMember = false ; for ( var i = 0 ; i < validators . length ; i ++ ) { isMember = this . dataUtils . checkGroup ( validators [ i ] . groups , groups ) ; if ( isMember && ( this . dataUtils . checkEventToValidate ( validators [ i ] . eventToValidate , event ) ) ) { var extraRes = validators [ i ] . validate ( value , groups , event ) ; if ( extraRes && extraRes . length > 0 ) { if ( res == null ) { res = extraRes ; } else { res = res . concat ( extraRes ) ; } if ( this . breakOnMessage ) { break ; } } } } if ( res && res . length > 0 ) { if ( this . groupMessages ) { var msgGroup = ariaUtilsJson . copy ( this . message ) ; msgGroup . subMessages = res ; return [ msgGroup ] ; } else { return res ; } } return null ; } }
loops through each validator within the multiple validator and calls it's validate method.
@param {String} value to be validated.
@param {Array} groups to validate against.
@param {String} event that validation occurs on.
@return {Object} res containing any message objects if validation fails.
loops through each validator within the multiple validator and calls it s validate method .