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.

Confirmation Message Template Tag

  1. I'd like an easy way to output the confirmation message when a form is submitted (not via ajax) in a particular place within my page template.

    Ideally there would be some template tag to call like gravity_confirmation_message($echo=true, $formatted=true) that would output a message only if there was one..

    I'm currently using the gform_confirmation filter within handle_confirmation to get the confirmation message and creating my own set of functions to achieve this, but I think it'd be very convenient if there were a template tag to use for those that need as much control as possible..

    Posted 13 years ago on Thursday May 5, 2011 | Permalink
  2. Can you provide an explanation on how this would be used and possibly some example mockups so we can better understand the use case?

    Posted 13 years ago on Friday May 6, 2011 | Permalink
  3. Sure, an example of my situation would be easiest. Take a look at this example wireframe I threw together showing the page layout of a site I'm working on.. http://d.pr/C0KV .. As you can see, the form on the page is pretty far down because of a large image and content above it. So, when the form is submitted and the page reloads, it's not immediate to the user that the submission was successful unless they scroll down to see where the form used to be.

    In the wireframe you'll also see where I'm outputting the confirmation message via the workaround as described above, where the user is guaranteed to see it (at the top of the page).

    The current workarounds of using JS to auto-scroll to the #gforms_confirmation_message, or absolutely position the confirmation via CSS is not ideal, especially from an accessibility perspective. Additionally, the CSS method wouldn't work in my particular case because of the need for position:relative on parent elements of the form.

    Posted 13 years ago on Friday May 6, 2011 | Permalink
  4. @Tony In Multi-Page forms or forms that use AJAX the page will automatically anchor to the confirmation message when it is submitted. If you want to always have it anchor to the confirmation message on non-AJAX and non-multi-page forms you can make use of an available hook to do this:

    http://www.gravityhelp.com/documentation/page/Gform_confirmation_anchor

    The reason why it doesn't currently do this by default is this hook was introduced at a later date and we didn't want to change the core functionality to disrupt what users may have already been doing.

    Posted 13 years ago on Friday May 6, 2011 | Permalink
  5. I agree and understand why you didn't implement the anchor functionality by default. Still though, mark me down as requesting a template tag for the confirmation message :)

    Posted 13 years ago on Wednesday May 11, 2011 | Permalink