Skip to content

Commit 30ce736

Browse files
authored
gppa-click-image-choice-image-wrapper.js: Added snippet to trigger dynamic populate on Image Choice's Wrapper getting clicked.
1 parent a6e4263 commit 30ce736

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* Gravity Wiz // GP Populate Anything // Trigger GPPA update on Image Choice Wrapper Click.
3+
* http://gravitywiz.com/documentation/gravity-forms-populate-anything
4+
*
5+
* Instructions:
6+
* 1. Install our free Custom Javascript for Gravity Forms plugin.
7+
* Download the plugin here: https://gravitywiz.com/gravity-forms-code-chest/
8+
* 2. Copy and paste the snippet into the editor of the Custom Javascript for Gravity Forms plugin.
9+
*/
10+
// If Image Choice's Image Wrapper is clicked, make sure to trigger the `change.gppa` event.
11+
window.gform.addAction(
12+
'gform_input_change',
13+
(elem , formId, fieldId) => {
14+
if (
15+
!$(elem)
16+
.parent()
17+
.hasClass('gfield-image-choice-wrapper-inner')
18+
) {
19+
return;
20+
}
21+
$(elem).trigger('change.gppa');
22+
}
23+
);

0 commit comments

Comments
 (0)