Replace Live Merge Tags Individually and Show Spinner
- Install this snippet with our free Custom JavaScript plugin. https://gravitywiz.com/gravity-forms-code-chest/
Code
Filename: gppa-replace-live-merge-tags-individually-and-show-spinner.js
/**
* Gravity Perks // Populate Anything // Replace Live Merge Tags Individually and Show Spinner
* https://gravitywiz.com/documentation/gravity-forms-populate-anything/
*
* 1. Install this snippet with our free Custom JavaScript plugin.
* https://gravitywiz.com/gravity-forms-code-chest/
*/
gform.addFilter( 'gppa_loading_target_meta', function( targetMeta, $elem, context ) {
targetMeta[0] = $elem;
targetMeta[1] = 'gppa-spinner';
if( $elem.is( 'span' ) && $elem.data( 'gppa-live-merge-tag' ) ) {
$elem.html( '' );
}
return targetMeta;
} );