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.

Is there a way to insert a form into the confirmation using gform_confirmation

  1. eschoolnews
    Member

    I am trying to come up with a way to have a form call another gravity form after a form is successfully submitted (a follow-up survey). I do not want to use a multi-page form as the 2nd form is not planned to appear every time, for every form submission.

    I have successfully changed the confirmation message using gform_confirmation, but I cannot use the template tag ( gravity_form(#) ) in a function that is called in the header as it will just display the at the top of the page.

    Two Questions:
    Is there a way to know the form submission was a success that could assign a variable or be used in an IF() in the template? Then I could just place the 2nd form like any other form in the template.

    Is there a way to store the output of the function gravity_form() into the $confirmation array? I know this is a PHP question, but it is where I am going to search next on.

    Thank you.

    Posted 11 years ago on Wednesday May 23, 2012 | Permalink
  2. David Peralty

    Can you not selectively redirect them to the other form on another page?

    Posted 11 years ago on Thursday May 24, 2012 | Permalink
  3. eschoolnews
    Member

    Thinking of doing that, but this is one of those requests that looked easy, but not in implementation. "Think of the survey at the end of a receipt" is the designers vision.

    I recalled how I can capture the gravity_form(#) output, and store it into a var, using output buffering (ob_start) but that option comes with 100s of warnings not to.

    Our confirmation page is the end of the site registration process, before the confirmation it is sending data to an external DB, then has a number of options on the confirmation page, such as, return to what you were reading, edit your profile, go to 10 things that may interest you, and it automatically logs the person into WordPress. Lots going on there, and lots of things that would need to be passed to the new forms landing page.

    Having a little trouble with the redirect in that I will need to pass all that information to the new form as if they were where they started. I could pack it all in the URL, or store it in a temporary DB to be retrieved by the new forms landing page ... or come up with an easy option that is evading me at the moment.

    The form that they want to add is 2 quick optional questions, that is all. Wording is not the same but.. Was this process easy? What would you change? They require that it should not take them away from the current "landing page" or what the end user really wants to do, which is go back to the part of the site they want to read, nor should it be overly intrusive.

    Will try to get the key code out of the process to share, but cannot publicly share much of it.

    Posted 11 years ago on Thursday May 24, 2012 | Permalink
  4. eschoolnews
    Member

    Thinking outside the box...
    I think I found a way to get the form into the page, but it is by using the code from a cached version of the form to populate gform_confirmation. I am testing it, and I know this will most likely cause problems when upgrading, but could this be a workable solution for my case?

    The W3 total cached pages work, why would this be any different?

    Posted 11 years ago on Thursday May 24, 2012 | Permalink