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.

How to append content to a confirmation page

  1. nes49
    Member

    I'm a new user, and am impressed with all the features you've built into this system.

    I'm having trouble with one piece of the puzzle:

    After form submission, I'd like to present the user with a confirmation page -- and I'm using {all_fields} to show that. I'd also like to add some additional content after that, and that content depends on the values of a couple of the form fields.

    I've worked with the gform_confirmation filter, and I find I can modify the $confirmation page (e.g. translate everything to upper case), and I can replace it entirely with other code, but I don't seem to be able to add anything before or after it.

    I can rewrite the page from the ground up using individual fields, but that gives up the benefit that {all_fields} has in automatically adjusting as the form changes.

    So before I start down that road, I thought I'd check to see if I'm just missing something. As an example,

    Example code: http://pastie.org/6483763
    The logfile: http://pastie.org/pastes/6483847/text

    but the page displayed to the user doesn't show the content before the gforms_confirmation_message div

    Asking the question may have helped me figure out an answer. I'll try parsing the $confirmation string and inserting my code inside the gforms_confirmation_message div. But if there's a simpler solution, I'd love to hear it.

    Posted 11 years ago on Thursday March 14, 2013 | Permalink
  2. doesn't show the content before the gforms_confirmation_message div

    That's correct. The confirmation message is shown within the confirmation div. From your log file, it looked like this is working. What part are you not happy with?

    Posted 11 years ago on Thursday March 14, 2013 | Permalink
  3. nes49
    Member

    All is fine. It's just that I didn't realize how the <div> was going to affect the output until I did the debugging needed to post a question here.

    I've ended up with the following solution (for anyone who may find this thread later):

    I put a token, e.g., "##MSG1##", on the confirmation page in the form. In the function, I set up the string, e.g. $msg1, that I wanted to appear based on the values in the $lead array, and then used

    $newconfirm = str_replace ( '##MSG1##', $msg1, $confirmation );
    return ( $newconfirm );

    Not hard, just wan't obvious that was one way to accomplish what I wanted.

    Posted 11 years ago on Friday March 15, 2013 | Permalink
  4. Glad you got that working.

    Posted 11 years ago on Sunday March 17, 2013 | Permalink

This topic has been resolved and has been closed to new replies.