Listen for Populate Anything Updates on a Specific Field

Code

Filename: gppa-listen-for-updates-on-specific-field.js

/**
 * Gravity Perks // Populate Anything // Listen for Populate Anything Updates on a Specific Field
 * https://gravitywiz.com/documentation/gravity-forms-populate-anything/
 */
$( document ).on( 'gppa_updated_batch_fields', function( e, formId, updatedFieldIDs ) {
	var targetFieldId = 3;
	if ( parseInt( formId ) === GFFORMID && $.inArray( String( targetFieldId ), updatedFieldIDs ) !== -1 ) {
		console.log( 'Target field updated!' );
	}
} );

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.