Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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;
}
});
});
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
You can’t perform that action at this time.