PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

At query string parameter on page break

  1. Hi,

    I wondered if it is possible to add URL viriables on page break.
    So if I press 'NEXT' to go to the next form page their will be "?step=2" added to the URL for example.

    Thanks,

    Tom

    ps. Love this plugin!!!

    Posted 11 years ago on Thursday November 15, 2012 | Permalink
  2. David Peralty

    Can you give me more information on why you would want to do this?

    There is this tidbit here:
    http://gravitywiz.com/2012/05/04/pro-tip-skip-pages-on-multi-page-forms/

    Posted 11 years ago on Thursday November 15, 2012 | Permalink
  3. Hi David,

    Thanks for your respond.
    The thing is that I use the form in the context of a larger page. Let's say for example that I have a page decided in two parts: the left, and the right part.

    In the left part I have the form.
    In the right part I give some additional information (mostly image based).

    After a page-break (So next step in the form) I want to show other content in the right side of the page and I'd know what to show based upon the URL parameters.

    Thanks,

    Tom

    Posted 11 years ago on Thursday November 15, 2012 | Permalink
  4. David Peralty

    You could use this to set a session variable, or control the other side:
    http://www.gravityhelp.com/documentation/page/Gform_post_paging

    Posted 11 years ago on Thursday November 15, 2012 | Permalink
  5. Thanks David for your respond.
    I think this is what I need.
    I stil haven't figured the whole 'hook' thing out, but I quess that's a noob-thing. Not sure where I should put that. I'll try to figure it out.
    CHeers, Tom

    Posted 11 years ago on Friday November 16, 2012 | Permalink
  6. David Peralty

    Hooks and filters go in your theme's functions.php file. Take a look through our documentation.
    http://www.gravityhelp.com/documentation/page/Where_Do_I_Put_This_Code%3F

    Posted 11 years ago on Friday November 16, 2012 | Permalink
  7. Hi David,
    Thanks but I give up on this one...

    First of all, It's completely not clear to me where to paste the code. Your link doesn't help on that. (Sure, I found functions.php and form_display.php but then I'm lost)
    Secondly, sessions variables are too much.

    Just need a URL parameter saying 'p=1' or something simple like that that moves along with the current page.

    This also helps with tracking dropout points (for example when using Google Analytics studying the path to the goal. I thought this would be a common thing but I guess it's not). With only session variables you cannot do that (as far as I know).

    Anyway. Thanks,

    Tom

    Posted 11 years ago on Tuesday November 20, 2012 | Permalink
  8. David Peralty

    The issue you are having is related to how Gravity Forms paginates its forms. It isn't really three separate pages of forms, but a single page form that looks like it is on three pages, hence why there isn't any kind of URL variable for you to hook into. When you page through the form, the URL should change, but it will be something like #3 appended to it. Can you make sure AJAX is off on your form?

    Can you link to your form so I can see what you have currently?

    As for where to put code. It goes in your THEME's functions.php file.

    I would love to help you get this sorted if you'd continue to work with me on it.

    Posted 11 years ago on Tuesday November 20, 2012 | Permalink
  9. David, you are a hero!
    Here is a link to the form: http://bit.ly/TVSykP
    Ajax is off yes!
    Tom

    Posted 11 years ago on Tuesday November 20, 2012 | Permalink
  10. Any news on this topic?
    Thanks

    Posted 11 years ago on Wednesday November 28, 2012 | Permalink
  11. David Peralty

    Here is what one of our developers told me.

    The trick here is to use the gform_form_tag hook and add the extra query string item with the current page number. The following code snippet should do the trick.
    Just tell them to place the correct page URL.

    add_filter("gform_form_tag", "form_tag", 10, 2);
    function form_tag($form_tag, $form){
    $form_tag = preg_replace("|action='(.*?)'|", 'action="YOUR_PAGE_URL?my_page=' . GFFormDisplay::get_source_page($form["id"]) . '"', $form_tag);
    return $form_tag;
    }
    Posted 11 years ago on Wednesday November 28, 2012 | Permalink