From 43741b7620e628c1ef5b120e984aded51befc0ef Mon Sep 17 00:00:00 2001 From: Dan Coates Date: Fri, 22 Aug 2014 12:29:52 +1000 Subject: [PATCH] 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 --- js/foundation/foundation.abide.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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); -- 2.47.2