How can I have the form still show with the confirmation above it after submit? By default, the form disappears. Thanks!
In the confirmation message you can include the gravity form short code. So when the Confirmation message is displayed, the form will also be displayed. See below image:
We've version 2.1.1 and this works well for us.
Showing the form with the confirmation can be confusing to the user; however, it is possible to include the shortcode for the form in the confirmation of the form. I've never tested this including the same form within its own confirmation.
Another alternative is using the GP Reload Form plugin (demo). It allows the user to reload the submitted form for multiple submissions without ever refreshing the page. It also supports automatically refreshing the form after X number of seconds, so the user sees the confirmation and then the form reloads.
Disclaimer: GP Reload Form is my own plugin.
Use this hook in functions.php
:
add_filter( 'gform_confirmation_FORMID', 'gravityforms_custom_confirmation', 10, 4 );
// change FORMID to your gravity form ID
function gravityforms_custom_confirmation( $confirmation, $form, $entry, $ajax ) {
// intentionally do nothing
}
This code ensures that no redirection, no confirmation or anything else is done on submit. On the contrary, you can process $_POST values on the same page after submit.
Normal submit works. I have not tested with ajax="true"
, though.
-
This does work, but keep in mind if you leave this function blank, NOTHING will happen after submitting the form. It will not even trigger the jQuery
gform_confirmation_loaded
event. – Gavin Apr 18 '17 at 10:12 -
Exactly: that was the point. Point is that you can have a form created in gravityforms for processing in your own way on the page reload by your own functions. In this way, greavity forms is just a provider of the form, but you decide what happens with it afterwards. Unfortunately, they don't allow advanced customization like this in the admin or settings of the form. – dusoft Apr 20 '17 at 8:28