Gravity forms - how not to hide a field on AJAX Submit?

How can I show the confirmation form above after submitting? By default, the form disappears. Thank!

+3


source to share


3 answers


You can include a severity shortcode in the confirmation message. So when a confirmation message is displayed, the form will also be displayed. See below picture:

enter image description here



We have version 2.1.1 and it works well for us.

+2


source


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 makes sure there is no redirect, confirmation or anything else to send. Conversely, you can process $ _POST values ​​in one page after submission.

Normal submission of work. However, I have not tested ajax="true"

.

+2


source


Displaying a confirmation form can be confusing for the user; however, you can provide a shortcode for the form to submit the form. I have never tested this including the same form in my own validation.

Another alternative is to use the GP Reload Form plugin ( demo ). This allows the user to reload the submitted form for multiple views without refreshing the page. It also supports automatic updating of the form after X seconds, so the user sees the confirmation and then reloads the form.

Disclaimer: GP Reload Form is my own plugin.

+1


source







All Articles