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.

Can I use merge tags in Gform confirmation?

  1. f_devocht
    Member

    I have a form that needs a custom confirmation message.
    I would like to use Gform confirmation but I can't figure out how to use merge tags in the confirmation message.
    I tried things like $form["fields"][0]["label"] which gives me the label of the first field, but I need the content.

    Posted 11 years ago on Monday December 10, 2012 | Permalink
  2. David Peralty

    Hi, I don't understand what you are trying to do. Can you provide me with more information please?

    Posted 11 years ago on Monday December 10, 2012 | Permalink
  3. f_devocht
    Member

    I have a form that gives a different confirmation message depending on the value of a field.
    In the documentation I found that I can use the 'Gform confirmation' for this (http://www.gravityhelp.com/documentation/page/Gform_confirmation)

    I would like to use the value of a form field to determine the confirmation message.
    for instance: if a visitor replied with "yes" in Field ID 17, I want the confirmation message to display a url with a number of merge tags.
    If they answered "no", I want to display that url with different merge tags.

    Posted 11 years ago on Monday December 10, 2012 | Permalink
  4. David Peralty

    So the details in the first example should give you exactly what you need, no?

    Posted 11 years ago on Monday December 10, 2012 | Permalink
  5. f_devocht
    Member

    How would I change that to:
    $confirmation = "Thanks for contacting us. We will get in touch with you soon, the answer we received to the question is YES". (where YES is retreived from a field that they answered to).

    I can use for example:
    $form["fields"][0]["type"]; //returns the type of the first field of the form

    But I want the content of that field, something like:
    $form["fields"][0]["content"];

    but that doesn't work

    Posted 11 years ago on Monday December 10, 2012 | Permalink
  6. David Peralty

    Are you planning on having the message pretty much be the same outside the values submitted? If so, you can do what you want easily in the Confirmation settings built into Gravity Forms. Let me know.

    Posted 11 years ago on Monday December 10, 2012 | Permalink
  7. f_devocht
    Member

    What I want to do is an extension of my question here:
    http://www.gravityhelp.com/forums/topic/pre-filling-a-form-with-the-data-of-the-previous-form

    I have a form that parents use to subscribe children in a school. This is strictly regulated and must be with exact date / time. When a parent wants to subscribe a 2nd child, that child gets the time of the first child (so nobody else can take his place).
    My first attempt at creating this was by using 2 seperate forms. First form is filled out and gets a confirmation message (text message on submission). In that confirmation message, there's a link to a pdf with the data they gave.
    In that confirmation message is also a 2nd link to form2, asking if they want to add a 2nd child. That form is filled with the date / time of the first form by using merge tags.
    You're welcome to try it out here: http://tinyurl.com/cn9v8km
    All this works fine but I want all data in one form, not in 2 seperate forms (also, what if a 3rd child??).

    So, I started from scratch and made 1 form for all childs like this: http://tinyurl.com/cquyquw
    Here I added a question at the bottom if an additional child must be subscribed.
    If no, the confimation message displays a thank you message with the pdf.
    If yes, the confirmation message displays the message with the pdf and an additional url to restart the form with some extra fields for the 2nd child.
    This works fine as will, however, the confirmation message is on a blank canvas because I'm using a conditional redirect like this:
    http://zackeryfretty.com/redirect-to-a-specific-url-based-on-submissions-with-gravity-forms/
    Again, welcome to try out the form to see what I mean.

    So I then stumbled across the Gform confirmation stuff and was thinking to use that, as the confirmation message stays 'inside' the website, not on a new blank page.
    I added this code to functions.php and it works fine, giving a different confirmation message according to the yes/no answer, but the problem is that I don't know how to add the url (with merge tags) to restart the form.

    Sorry for the long reply, I hope I made it somewhat clear ...

    Posted 11 years ago on Tuesday December 11, 2012 | Permalink
  8. f_devocht
    Member

    anyone who can steer me in the right direction? Been breaking my head over this for the last couple of days.

    Posted 11 years ago on Wednesday December 12, 2012 | Permalink