Gravity Wiz

Magically enhanced tutorials, snippets and plugins for Gravity Forms!

  • Gravity Perks
    • Gravity Perks
    • Tutorials & Snippets
    • About
  • Support
    • Documentation
    • Support
    • Account

Pro Tip: Skip Pages on Multi-Page Forms

Last updated August 21, 2019 | Written by David Smith 40 Comments

Looking to improve the navigational experience of your multi-page forms? Try our Multi-page Navigation perk. This plugin also supports setting a custom starting page for visitors who may have already completed previous pages of your form!

I’ll admit it. I’m a bit of a Gravity Wiz. And as such, I do a good bit of testing on really long multi-page Gravity Forms. When you’ve got an eight page form and the issue you’re trying to debug is on – you guessed it! – the last page, it can be a very tedious and painful experience.

Do you know this pain of which I speak? If so, here’s a little snippet that single-handedly (and quite succinctly) puts all those painful multi-page debugging memories behind you.

Download Code
<?php
/**
* Gravity Wiz // Gravity Forms // Skip Pages on Multi-Page Form
* http://gravitywiz.com/2012/05/04/pro-tip-skip-pages-on-multi-page-forms/
*/
add_filter("gform_pre_render", "gform_skip_page");
function gform_skip_page($form) {
if(!rgpost("is_submit_{$form['id']}") && rgget('form_page') && is_user_logged_in())
GFFormDisplay::$submission[$form['id']]["page_number"] = rgget('form_page');
return $form;
}
view raw gw-gravity-forms-skip-pages.php hosted with ❤ by GitHub

How do I install this?

Just copy and paste this snippet into your theme’s functions.php file.

How does it work?

To skip a page, simply append the ?form_page=2 parameter to the URL of any page on which you are displaying a Gravity Form. Update the 2 to whichever page you wish to display.

Standard usagehttp://yoursite.com/multi-page-form/?form_page=4
Used with other parametershttp://yoursite.com/?p=123&form_page=4
This snippet does a simple check to make sure the user is logged in before allowing any pages to be skipped. If you would like to lock this down so that only administrators can skip pages, let us know in the comments and we’ll be happy to demonstrate how this can be accomplished.

Summary

And there you have it! Working with multi-page forms just got a lot easier. Think of all those long forms with required fields on every page. You don’t have to shudder at the thought any more!

Did this resource help you do something awesome with Gravity Forms? Then you'll absolutely love Gravity Perks; a suite of 32+ essential add-ons for Gravity Forms with support you can count on.

  • View All Perks
  • Buy Gravity Perks

Filed Under: Snippets developer tip

Comments

  1. Martina says

    July 21, 2020 at 4:38 pm

    Hi! I also love your snippet! I used it for more than a year now but found out today (probably because of an Update) that it’s no longer working.

    If I append ‘ ?form_page=2’. to an URL I receive the Error: ‘Oops! We could not locate your form.’ The URL/form is working fine if I address it directly. Also if I access the multi-page form via another form I also get redirected to an address as / ?form_page=2#gf_16

    Thanks for your support!

    Reply
    • Samuel Bassah says

      July 22, 2020 at 6:36 am

      Hi Martina,

      We may have to take a closer look at your form and backend set up to identify what may be causing the error. If you are a Gravity Perks subscriber, could you please reach out to us via our support so we can assist you to troubleshoot this issue. Thanks! 😊

  2. John says

    July 2, 2020 at 6:13 am

    Hi David Thank you for this wonderful snippet i am facing an issue that if we jumped to next (2) page and if there is any error on the jumped page its going back to the first page with the error message at top and the end of the URL is turning to like this / ?form_page=2#gf_22

    what will be the issue?

    Reply
    • Ryan Donovan says

      July 2, 2020 at 10:15 am

      Hello, When mentioning an error on page two, what kind of error is coming up? This would require a more in-depth look into but Multi-page Navigation would allow the user to jump to any page of the form without error. If you are a Gravity Perks subscriber, could you please reach out to us via our support so we could take a closer look into your forms. Thanks! 😊

« Older Comments

Leave a Reply Cancel reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Categories

  • How To (64)
  • News (21)
  • Plugins (14)
  • Releases (7)
  • Resource (3)
  • Snippets (58)
  • Tutorials (57)
  • Updates (104)

Recent Posts

  • How to Send a Follow-Up and Pre-Fill Information
  • How to Update Posts with Gravity Forms
  • Gravity Wiz Weekly #104
  • The Complete Guide to Using Gravity Forms With Zapier
  • Gravity Wiz Weekly #103

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Copyright © 2021 · Powered by WordPress · Gravity Wiz LLC

  • Support
  • Affiliates
  • About
  • Sitemap
  • Gravity Perks
    â–¼
    • Gravity Perks
    • Tutorials & Snippets
    • About
  • Support
    â–¼
    • Documentation
    • Support
    • Account