Subscribe to Child Entry Updates

If you’re having issues getting this to work, try using our Gravity Forms Custom Javascript plugin. It handles ensuring the Nested Forms has fully initialized so you don’t have to.

Code

Filename: gpnf-subscribe-to-child-entry-updates.js

/**
 * Gravity Perks // Nested Forms // Subscribe to Child Entry Updates
 * https://gravitywiz.com/documentation/gravity-forms-nested-forms/
 *
 * If you're having issues getting this to work, try using our [Gravity Forms Custom Javascript](https://gravitywiz.com/gravity-forms-code-chest/)
 * plugin. It handles ensuring the Nested Forms has fully initialized so you don't have to.
 */
gform.addAction( 'gfcc_deferred', function() {
	
	// Get your Nested Forms JavaScript instance where "123" is the form ID and "4" is the Nested Form field ID.
	var gpnf = window.GPNestedForms_123_4;
	
	gpnf.viewModel.entries.subscribe( function( entries ) {
	  // Do whatever you want any time the child entries for your Nested Form field are updated.
	  console.log( entries );
	} );

} );

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.