June 24th, 2022: Updated to support repopulating Nested Form fields from Auto Save & Continue tokens.
Stop! There's a better way.
This snippet is available as a plugin with Gravity Perks, a suite of over 47 premium Gravity Forms plugins!
Overview
The Save and Continue functionality in Gravity Forms is one of my favorite features. I generally have a lot going on, and like many of you my workflow is often interrupted. Between Slack, Zoom, and some needy puppies, changing gears is simply a part of life. If you’ve ever had an interruption while filling out a long form, then you know how frustrating it can be to return to your form and have to start over again. Save and Continue removes that frustration by making it easy to save your progress.
One place where we think Save and Continue can be improved upon is the actual process. It requires more user interaction than we prefer. The normal Save and Continue process looks like this:
- While filling out the form, click Save and Continue at any time.
- The form saves your progress and displays or emails a link that you can use to continue later.
- Click on the link at some point in the future, and all of your progress is restored.
This process works well, but we thought it would be magical if the whole thing could be automated for logged-in users. Since WordPress already knows who is logged into the site, why not use that info to make Save and Continue automatic and seamless? So, we wrote a plugin to do just that.
Using the Plugin
Confirm that you have Gravity Forms installed and activated and that you’ve installed the plugin.
Once installed, simply enable Save and Continue on any of your forms. If a logged-in user adds any values to any page in a multi-page form, those values are automatically saved when navigating between pages. When they return to the form, those values will be automatically populated into the form on load.
Advanced Configuration Parameters
While the plugin doesn’t require any additional configuration, there are some advanced configuration options available. To use the advanced configuration options, you’ll need to add the following code to your theme’s functions.php file.
if ( class_exists( 'GW_Save_Continue_Auto_Load' ) ) {
new GW_Save_Continue_Auto_Load( array(
'form_ids' => array( 1, 2 ),
'enable_inline_confirmation' => false,
'auto_save' => true
) );
}
The class has three parameters.
– form_id array required
The IDs of the specific forms you want to use the advanced options on.
enable_inline_confirmation boolean optional
Whether to show the Save & Continue confirmation inline rather than on a separate page.
auto_save boolean optional
Whether the form should automatically save progress when navigating between pages. Set this to false to require the user to manually click the Save & Continue link to actually save their progress.
That’s It!
That’s all there is to it. Your site’s users will have a better experience thanks to some magic.
Did this resource help you do something awesome with Gravity Forms?
Then you'll absolutely love Gravity Perks; a suite of 47+ essential add-ons for Gravity Forms with support you can count on.
I’ve created a form and enabled save and continue. I’ve done the same in my sandbox and disabled virtually all plugins and deleted the custom code in my functions.php file. We’re using the BuddyBoss theme and platform, LifterLMS and Gravity forms.
A sample form is here:
https://masteraba.academy/test-form/
I tried installing the plugin, but that didn’t have any effect. The code worked as long as I was in the tab (i.e. I could refresh the tab and it stayed) but only logged in as an admin. And if I went to a new tab it didn’t save the data even though I was still logged in as that Admin.
If you can help I’d appreciate it. I’d love to get this working!
Hi Dianna,
This auto-save and continue snippet only save form field values when the user navigates from one page to another. The field value won’t be saved if you open the new tab before navigating from one page to another. If you’re looking for a solution that will save the field values on field change even before navigation from one page to another, then check out our GP Advanced Save and Continue Perk.
Best,
I was reading an issue where if I enter a field via ajax, it doesn’t save to that field when using saving and continue. I read I’m supposed to add some callback to gravity forms so that it will save the field value. I can’t find the instructions anywhere..
Hi Jake,
I’m not sure about the issue you’re referring. However, this is possible with our new GP Advanced Save and Continue Perk if you want to save field value on field input change. You can check it out.
Best,
One issue with this plugin as currently written is that it doesn’t actually check whether the “Save & Continue” feature is enabled for the form in question, which may cause multi-page forms to “remember” values from previous partial submission when they shouldn’t. (This is, in fact, exactly what happened on a site I maintain, and it ended up taking half a day to track down where the phantom values were coming from!)
I’d suggest adding a check similar to the following to the plugin’s is_applicable_form function to prevent this scenario:
$form = GFAPI::get_form($form_id); if (!$form[“save”][“enabled”]) { return false; }
Hi David,
Thanks for the heads up. We’ll pass this on to our dev team for investigation.
Best,
Hi. I really like this extension, thanks for the work! There is one small thing I need to fix, hope you can help with this.
With auto save on a draft submission is saved to the database when navigating to a next page. The gf_token however is not set at that point. This results in multiple draft submissions in the database before submitting (when you have more than 2 pages).
The resume token is set in the $_POST variable when revisiting the page. Is it possible to somehow set that $_POST variable after the first time navigating to a new page?
I can fix it by loading the resume token from the user meta, but to do this I have to edit the core code of Gravity Forms which I don’t want to do.
Not sure if this is bug or just the way it works at this point. If you want I can share an URL.
Thanks!
Hey Menmo, this is how the snippet works and while it is not the most efficient method, it’s fairly innocuous to have the extra draft submissions. With that said, the upcoming plugin version of this saves drafts on field change so we do track the “current” draft and save all changes to that same draft.
Hi,
Would there be anyway for this to function without forcing users filling out the form to login?
Thank you
Hi Anon,
Currently, the auto-save and continue snippet works only if the user is logged in. I’ll forward your request to have it work if the user isn’t logged in as a feature request.
Best,
This feature is coming soon in the perk-version of this snippet called GP Advanced Save & Continue. More on that soon!
Will this addon work with the Gravity Forms Partial Entries Add-On so that users can have a fallback of the URL? Or will that create problems to use both?
Hi Gigi,
The Partial Entries can be set up on the same form with the Save and Continue functionality.
Best,
A follow up question: where can an admin view these partial entries? They are not showing up on my GF backend.
Hi Gigi; those should be visible on the Gravity Forms Entries list.
Best,
Hello,
Thank you for this helpful plugin. I just have a question, I am allowing the users to see what saved forms they have in the user dashboard, so the plugin will show many saved forms for the same submission, is there a way to delete previous saved forms before doing auto save? I am only allowing the user to submit the form once so any other saved draft could be deleted safely. Any idea on that? Also, Is there any possibility that the autosave work at the very beginning when the user visit the page even before entering any data into the form?
Thank you
Hi Eyad,
We do not have a solution for deleting any saved forms. This will definitely require some customization to the snippet. Autosave on page load is also not available although we’re working on a future Perk, that will support autosave on field change which may work for you. If you have a Pro Gravity Perks License, get in touch with us via our support form and submit a feature request with more information on what you want.
Best,