Logo Pupungbp.com

Need a WordPress expert help?

Gravity Forms: Retain the Form After a Form Submitted

Last Updated: July 3, 2017 | Reading Time: < 1 minute

By default, if you use Gravity Forms, after you complete a form, a notification will be shown, and the form will be dismissed. Below is the script to retain the form after a form is submitted.

Just paste into functions.php and change the _id with the form ID.

add_filter( 'gform_pre_submission_filter_ID' , "show_confirmation_and_form" , 10 , 1 );
function show_confirmation_and_form($form) {
  $shortcode = '

Oops! We could not locate your form.

. '" title="false" description="false"]'; if ( array_key_exists( 'confirmations' , $form ) ) { foreach ( $form[ 'confirmations' ] as $key => $confirmation ) { $form[ 'confirmations' ][ $key ][ 'message' ] .= $shortcode; } } if ( array_key_exists( 'confirmation' , $form ) ) { $form[ 'confirmation' ][ 'message' ] .= $shortcode; } return $form; }

I found this script somewhere, but I will credit the original source once I found it.

Looking for an affordable WordPress solution?

We offer budget-friendly WordPress website development services to meet your needs. Prices start at $10.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.