Last active
May 2, 2017 21:19
-
-
Save Shelob9/0f201b8e6a108e35a9a5fd49dcd24193 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery( document ).ready( function ($ ) { | |
$( document ).on( 'cf.validate.fieldError', function( event, obj ){ | |
//make field fld123456 always validate false | |
if( 'fld123456' === obj.el.data( 'field' ) ){ | |
obj.inst.validationResult = false; | |
} | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery( document ).ready( function ( $ ) { | |
/**Run JavasScript when a Caldera Forms field is unsuccessfully validated!**/ | |
$( document ).on( 'cf.validate.fieldError', function( event, obj ){ | |
//make valid | |
obj.inst.validationResult = true; | |
}); | |
/** Run JavasScript when a Caldera Forms field is successfully validated!**/ | |
$( document ).on( 'cf.validate.fieldSuccess', function( event, obj ){ | |
///make invalid | |
obj.inst.validationResult = false; | |
}); | |
/** Run JavasScript when a Caldera Forms form is successfully validated!**/ | |
$( document ).on( 'cf.validate.FormSuccess', function( event, obj ){ | |
///make invalid | |
obj.inst.validationResult = false; | |
}); | |
/**Run JavasScript when a Caldera Forms form is unsuccessfully validated!**/ | |
$( document ).on( 'cf.validate.FormError', function( event, obj ){ | |
//make valid | |
obj.inst.validationResult = true; | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment