File tree Expand file tree Collapse file tree 1 file changed +27
-4
lines changed Expand file tree Collapse file tree 1 file changed +27
-4
lines changed Original file line number Diff line number Diff line change 471
471
} ,
472
472
473
473
checkForm : function ( ) {
474
- this . prepareForm ( ) ;
475
- for ( var i = 0 , elements = ( this . currentElements = this . elements ( ) ) ; elements [ i ] ; i ++ ) {
476
- this . check ( elements [ i ] ) ;
474
+ if ( $ ( this . currentForm ) . find ( '.bundle' ) . length > 0 ) {
475
+ this . prepareForm ( ) ;
476
+ var elements = this . elements ( ) ;
477
+ var optionMap = { } ;
478
+ for ( var i = 0 ; i < elements . length ; i ++ ) {
479
+ var el = elements [ i ] ;
480
+ var optionNumber = el . id . split ( '-' ) [ 2 ] ;
481
+ if ( ! optionMap [ optionNumber ] ) {
482
+ optionMap [ optionNumber ] = [ ] ;
483
+ }
484
+ optionMap [ optionNumber ] . push ( el ) ;
485
+ }
486
+ for ( var option in optionMap ) {
487
+ if ( optionMap . hasOwnProperty ( option ) ) {
488
+ var group = optionMap [ option ] ;
489
+ if ( group . length > 0 ) {
490
+ this . check ( group [ 0 ] ) ;
491
+ }
492
+ }
493
+ }
494
+ return this . valid ( ) ;
495
+ } else {
496
+ this . prepareForm ( ) ;
497
+ for ( var i = 0 , elements = ( this . currentElements = this . elements ( ) ) ; elements [ i ] ; i ++ ) {
498
+ this . check ( elements [ i ] ) ;
499
+ }
500
+ return this . valid ( ) ;
477
501
}
478
- return this . valid ( ) ;
479
502
} ,
480
503
481
504
// https://jqueryvalidation.org/Validator.element/
You can’t perform that action at this time.
0 commit comments