From: Dan Coates Date: Fri, 22 Aug 2014 02:29:52 +0000 (+1000) Subject: Abide: Moving check for custom validators before check for whether input X-Git-Tag: v5.4.3~11^2^2~2^2 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F5657%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Abide: Moving check for custom validators before check for whether input is a checkbox/radio input. This allows custom validators on checkbox and radio inputs as well as other inputs. This is in relation to #5656 --- diff --git a/js/foundation/foundation.abide.js b/js/foundation/foundation.abide.js index cd6471c86..13deb8533 100755 --- a/js/foundation/foundation.abide.js +++ b/js/foundation/foundation.abide.js @@ -180,17 +180,17 @@ parent = direct_parent.parent(); } + if (validator) { + valid = this.settings.validators[validator].apply(this, [el, required, parent]); + validations.push(valid); + } + if (is_radio && required) { validations.push(this.valid_radio(el, required)); } else if (is_checkbox && required) { validations.push(this.valid_checkbox(el, required)); } else { - if (validator) { - valid = this.settings.validators[validator].apply(this, [el, required, parent]); - validations.push(valid); - } - if (el_patterns[i][1].test(value) && valid_length || !required && el.value.length < 1 || $(el).attr('disabled')) { validations.push(true);