gprf-reload-globally.js

By default, GPRF scopes it’s replacement to a static container. If the user is including multiple instances of the same form on the same page (which GF does not support by default), all instances of the form will be submitted but only the submitted instance will be reloaded. Use this snippet to reload all forms of the same ID.

Code

Filename: gprf-reload-globally.js

/**
 * Experimental Snippet 🧪
 * By default, GPRF scopes it's replacement to a static container. If the user is including multiple instances of the same form 
 * on the same page (which GF does not support by default), all instances of the form will be submitted but only the submitted
 * instance will be reloaded. Use this snippet to reload all forms of the same ID.
 */
gform.addFilter( 'gprf_replacing_elem', function( $replacingElem, formId ) { 
    return jQuery( '#gform_confirmation_wrapper_' + formId + ', .gform_confirmation_message_' + formId + ', #gform_wrapper_' + formId );
} );

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.