Load all links for Edit Entry

Use the snippet with Gravity Perks Easy Pass Through Edit Entry Snippet

  1. Install this snippet with our free Custom JavaScript plugin. https://gravitywiz.com/gravity-forms-code-chest/

Code

Filename: gpmpn-render-all-page-links-on-load.js

/**
 * Gravity Perks // Multi-Page Navigation // Load all links for Edit Entry
 * https://gravitywiz.com/documentation/gravity-forms-multi-page-navigation/
 *
 * Use the snippet with Gravity Perks Easy Pass Through Edit Entry Snippet
 * https://github.com/gravitywiz/snippet-library/blob/master/gp-easy-passthrough/gpep-edit-entry.php
 *
 * 1. Install this snippet with our free Custom JavaScript plugin.
 *    https://gravitywiz.com/gravity-forms-code-chest/
 */

var $formElem = $( 'form#gform_GFFORMID' );
var $steps    = $formElem.find( '.gf_step' );

// reload all step links
$steps.each( function( index ) {
	var stepNumber = index + 1;
	$(this).html(getPageLinkMarkup(stepNumber, $(this).html())).addClass( 'gpmpn-step-linked' );
} );

function getPageLinkMarkup( stepNumber, content ) {
	return '<a href="#' + stepNumber + '" class="gwmpn-page-link gwmpn-default gpmpn-page-link gpmpn-default">' + content + '</a>';
};

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.