allow for resetting errors via ArrayInput setErrors

This commit is contained in:
rlx 2012-02-21 08:22:45 +00:00
commit 3ff120873b

View file

@ -177,7 +177,9 @@ Ox.ArrayInput = function(options, self) {
that.setErrors = function(values) { that.setErrors = function(values) {
self.$input.forEach(function($input) { self.$input.forEach(function($input) {
values.indexOf($input.value()) > -1 && $input.addClass('OxError'); $input[
values.indexOf($input.value()) > -1 ? 'addClass' : 'removeClass'
]('OxError');
}); });
}; };