File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed
Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 154154 var $input = $ ( this ) ;
155155 $input . valAttr ( 'async' , false ) ;
156156 $ . each ( $ . split ( $input . attr ( 'data-validation' ) ) , function ( i , validatorName ) {
157- console . log ( validatorName ) ;
158157 var validator = $ . formUtils . validators [ 'validate_' + validatorName ] ;
159158 if ( validator && validator . async ) {
160159 $input . valAttr ( 'async' , 'yes' ) ;
Original file line number Diff line number Diff line change 8484 files = $input . get ( 0 ) . files || [ ] ,
8585 mime = '' ,
8686 allowedTypes = _getTypes ( $input ) ;
87- console . log ( files [ 0 ] ) ;
8887
8988 if ( files . length ) {
9089 $ . each ( files , function ( i , file ) {
Original file line number Diff line number Diff line change 5555 . find ( '*[data-validation]' )
5656 . valAttr ( 'event' , 'keyup change' )
5757 . on ( 'validation' , function ( evt , valid ) {
58- if ( ! isCheckingIfFormValid ) {
58+ if ( ! isCheckingIfFormValid ) {
5959 isCheckingIfFormValid = true ;
6060 var $form = $ ( this ) . closest ( 'form' ) ;
6161 if ( valid && peekIfFormIsSuccessfullyValidated ( $form , this , conf ) ) {
103103 var allValid = true ;
104104 $form . find ( '[data-validation]' ) . each ( function ( ) {
105105 if ( this !== excludeInputElement ) {
106- var $elem = $ ( this ) ;
107- if ( ! $elem . hasClass ( config . successElementClass ) || $elem . hasClass ( config . errorElementClass ) ) {
106+ var $elem = $ ( this ) ,
107+ hasSuccessfullyValidated = $elem . hasClass ( config . successElementClass ) ,
108+ isOptional = $elem . valAttr ( 'optional' ) === 'true' ,
109+ isInvalid = $elem . hasClass ( config . errorElementClass ) ;
110+ if ( isInvalid || ( ! hasSuccessfullyValidated && ! isOptional ) ) {
108111 allValid = false ;
109112 return false ;
110113 }
You can’t perform that action at this time.
0 commit comments