diff --git a/js/validator.js b/js/validator.js index f59a6b7..d7a21c2 100644 --- a/js/validator.js +++ b/js/validator.js @@ -200,6 +200,18 @@ var $block = $group.find('.help-block.with-errors') var $feedback = $group.find('.form-control-feedback') + // check that no other input in same group has error + var $otherHaserror = false + $group.find(':input').each(function($i, $other) { + var $errors = $($other).data('bs.validator.errors') + if ($errors && $errors.length) { + $otherHaserror = true + return false + } + }) + if ($otherHaserror) + return; + $block.html($block.data('bs.validator.originalContent')) $group.removeClass('has-error')