Gravity Forms is a powerful plugin for WordPress that allows you to run and manage forms as simple as a contact form or advanced as an application form.
There was, until recently, a massive feature missing – a ‘review’ page so form users can review their information before submitting it.
As of version 1.9.5 (note that 2.1.1.25 added support for the ‘save and continue’ feature) – Gravity Forms natively supports a ‘review’ page. However it must be enabled using a WordPress filter.
Why would I use this instead of what GravityWiz have?
Long before this was an option GravityWiz offered a free Gravity Forms customisation – Better pre-submission Confirmation.
Why would you use this instead?
- Native features are always more reliable – as Gravity Forms is developed this feature will be considered and ‘patched’ if issues occur
- Better implementation – with this method you can add the ‘review’ page to all forms, current and future, in one simple step – the GravityWiz method requires you to add a page, add an ‘HTML’ field, add a shortcode and if you have other form creators – instruct them in how to do this
- Support – if you run into any issues you can contact Gravity Forms for support as part of your existing license, where as with the GravityWiz method you require an additional licence for any support
- ‘Save and continue’ compatibility – the code available on the GravityWiz website doesn’t support the ‘Save and continue’ feature.
How to activate the review page?
The PHP code below will activate the ‘review’ page for all forms.
To install I suggest you create a custom plugin, add the script to the custom plugin and enable the plugin. For instructions on how to do this see How to create a WordPress plugin for your custom functions.
add_filter( 'gform_review_page', 'add_review_page', 10, 3 ); function add_review_page( $review_page, $form, $entry ) { // Enable the review page $review_page['is_enabled'] = true; // Populate the review page $review_page['content'] = GFCommon::replace_variables( '{all_fields}', $form, $entry ); return $review_page; }
Once installed and activated forms will have an additional page, the ‘submit’ button on your final page will become ‘Review Form’ and the final page will display all information that has been provided by the user. The form is not submitted until they click ‘Submit’ on the review page.
How can I customise this code?
Run on a specific form only
To only use this form on a specific form you will need to add a form id check – form example:
// This will only run on form id 1 add_filter( 'gform_review_page', 'add_review_page', 10, 3 ); function add_review_page( $review_page, $form, $entry ) { if (1 == $form['id'] ) { // Enable the review page $review_page['is_enabled'] = true; // Populate the review page $review_page['content'] = GFCommon::replace_variables( '{all_fields}', $form, $entry ); } return $review_page; }
How to add text to the confirmation page
To add text to the confirmation page, for example an instruction above the information and a terms and conditions below, you can modify $review_page[‘content’].
For example
add_filter( 'gform_review_page', 'add_review_page', 10, 3 ); function add_review_page( $review_page, $form, $entry ) { // Enable the review page $review_page['is_enabled'] = true; // Populate the review page $review_page['content'] = '<p>Please review the information below before submitting the form. If you would like to make any changes use the "Preview" button at the bottom of the page.</p>'; $review_page['content'] .= GFCommon::replace_variables( '{all_fields}', $form, $entry ); $review_page['content'] .= '<p>The submitted form and email <strong>will not</strong> be retained by this website or shared with any third-parties.</p>'; return $review_page; }
Change the ‘Review Form’ button text
The example below shows how to change the ‘Review Form’ button text to ‘Review & Submit’.
add_filter( 'gform_review_page', 'add_review_page', 10, 3 ); function add_review_page( $review_page, $form, $entry ) { // Enable the review page $review_page['is_enabled'] = true; $review_page['nextButton']['text'] = 'Review & Submit'; // Populate the review page $review_page['content'] = GFCommon::replace_variables( '{all_fields}', $form, $entry ); return $review_page; }
More information: https://www.gravityhelp.com/documentation/article/gform_review_page/