File tree Expand file tree Collapse file tree 1 file changed +17
-5
lines changed Expand file tree Collapse file tree 1 file changed +17
-5
lines changed Original file line number Diff line number Diff line change 341
341
342
342
// Apply error style to invalid inputs
343
343
$ . each ( errorInputs , function ( i , $input ) {
344
+ var $parent = $input . parent ( ) ;
345
+ // Twitter bs
346
+ if ( $parent . hasClass ( 'input-group' ) ) {
347
+ $parent = $parent . parent ( ) ;
348
+ }
349
+
344
350
if ( config . borderColorOnError !== '' ) {
345
351
$input . css ( 'border-color' , config . borderColorOnError ) ;
346
352
}
347
353
$input
348
- . addClass ( config . errorElementClass )
349
- . parent ( )
350
- . addClass ( 'has-error' ) ;
354
+ . addClass ( config . errorElementClass ) ;
355
+ $ parent
356
+ . addClass ( 'has-error' ) ;
351
357
} ) ;
352
358
353
359
// display all error messages in top of form
367
373
// Display error message below input field
368
374
else {
369
375
$ . each ( errorInputs , function ( i , $input ) {
370
- var $parent = $input . parent ( ) ,
371
- $errorSpan = $parent . find ( 'span[class=' + config . errorMessageClass + ']' ) ;
376
+ var $parent = $input . parent ( ) ;
377
+
378
+ // Twitter bs
379
+ if ( $parent . hasClass ( 'input-group' ) ) {
380
+ $parent = $parent . parent ( ) ;
381
+ }
382
+
383
+ var $errorSpan = $parent . find ( 'span[class=' + config . errorMessageClass + ']' ) ;
372
384
if ( $errorSpan . length > 0 ) {
373
385
$errorSpan . text ( ', ' + $input . valAttr ( 'current-error' ) ) ;
374
386
} else {
You can’t perform that action at this time.
0 commit comments