Skip to content

Commit 34debb0

Browse files
committed
Fix applying has-success and has-error classes to the same container in case of using .input-group.
1 parent 0cd6b32 commit 34debb0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

form-validator/jquery.form-validator.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,12 @@
232232
);
233233

234234
if(validation === true) {
235-
$elem
235+
var $parent = $elem
236236
.addClass('valid')
237-
.parent()
238-
.addClass('has-success'); // twitter bs
237+
.parent();
238+
239+
if($parent.hasClass("input-group")) $parent = $parent.parent();
240+
$parent.addClass('has-success'); // twitter bs
239241
} else if(validation !== null) {
240242

241243
_applyErrorStyle($elem, conf);

0 commit comments

Comments
 (0)