Skip to content

Commit 5a34694

Browse files
committed
gf-recalculate-of-image-wrapper-click.js: Added snippet to ensure calculations as soon as we click the image wrapper.
1 parent ed8d79c commit 5a34694

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* Gravity Perks // Gravity Forms // Recalculate on checkbox change
3+
* https://gravitywiz.com/
4+
*
5+
* Instructions:
6+
*
7+
* 1. Install this snippet with our free Custom JavaScript plugin.
8+
* https://gravitywiz.com/gravity-forms-code-chest/
9+
*/
10+
$( '#gform_GFFORMID input:checkbox, #gform_GFFORMID input:radio' ).on( 'change', function (event) {
11+
var $target = $( event.target );
12+
if ( !$target.closest( '.gfield-image-choice-wrapper-inner' ).length ) {
13+
return;
14+
}
15+
16+
var _GFCalc = rgars( window, 'gf_global/gfcalc/{0}'.gformFormat( GFFORMID ) );
17+
_GFCalc.runCalcs( GFFORMID, _GFCalc.formulaFields );
18+
});

0 commit comments

Comments
 (0)