Skip to content

Commit c48f20b

Browse files
committed
victorjonsson#591 Make toggleDisabled work with checkbox-group validator
1 parent aa778cf commit c48f20b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/modules/toggleDisabled.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,17 @@
6969
.on('afterValidation', afterValidationCallback)
7070
.on('blur', function() {
7171
$(this).valAttr('have-been-blurred', 1);
72+
})
73+
.each(function() {
74+
var $input = $(this),
75+
validationRules = $input.attr('data-validation');
76+
if (validationRules.indexOf('checkbox_group') > -1) {
77+
$input.closest('form').find('input[name="'+$input.attr('name')+'"]').each(function() {
78+
$(this).on('change', function() {
79+
$input.validate();
80+
});
81+
});
82+
}
7283
});
7384

7485

0 commit comments

Comments
 (0)