On my website, I have a three-step survey with two pagebreaks accordingly. I know that not all of the visitors will make it through the whole form, so I'd like to be saving/emailing form information after each step is completed. This way, I would at least have partial information if the whole form is not submitted on the final step.

I see two ways to accomplish this. The first one is to have three single-step surveys chained together. The second one is to use the webform's advanced validation code in order to email or save partial information after each step.

Which approach is preferable? Or am I missing something and there's yet another, better way?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mshepherd’s picture

This may be helpful to you:
#226907: Patch adding save draft feature

jamix’s picture

Thank you for the link. This is not what I'm looking for, however, as I cannot rely on the users to press the "Save Draft" button. I do want to get as many pieces of information even if the form was not completed fully, though. Guess I'll have to go with the "chained forms" solution.

rurri’s picture

jamix,

Did you find anything that would work yet? I need the exact same thing and stumbled on this thread. We have a request for information page and want the first page to just be name and e-mail. That way if they abandon the process we at least have some way to prod them to finish.

quicksketch’s picture

Version: 5.x-2.9 »
Category: support » feature

This is now much more feasible in the 3.x version now that we have a mechanism for saving a draft from #226907: Patch adding save draft feature. I think it would be reasonable to make an option for "Automatically save draft between pages". It would also make sense to rename the existing "Allow drafts" option to "Allow manually saved drafts" or something similar, so you can choose whether to have automatic drafts, manual drafts, or both.

seschneck’s picture

Version: » 6.x-3.x-dev

Subscribing for the ability to automatically save draft between pages. Would it be easiest to combine the functionality of the "save draft" button into the "next page" button? That would accomplish both saving between pages, and also the paging issue addressed in #834526: Keep user on the same page when saving as Draft?

The comment queue is forcing me to choose a new version to submit this subscription comment, so I apologize if 3.x-dev is not the appropriate choice.

quicksketch’s picture

Reviving this issue. gwlangie has contacted me about sponsoring this feature to speed up its implementation timeline.

To re-iterate what I anticipate as options here... there is currently a single check box for "Allow save as draft". This patch would make it into two checkboxes:

[x] Automatically save as draft after every page
[x] Show separate "Save as Draft" button

The label of the buttons would remain unchanged. To change the label of buttons, we should look into #241523: Allow back and next buttons to customised.

gwlangie’s picture

Quicksketch,

I'm not looking for the email function. I don't believe it is necessary.

If it is possible, it would be nice to return to the survey where the user left off but this is beyond our agreement.

With that said, the functionality I am looking for is to have the page automatically saved after pressing the "Next Page" button. The user doesn't even need to know the form is being saved.

Let me know what you think.

quicksketch’s picture

Title: Multistep forms: Save/email information after each step is completed » Multistep forms: Save information after each step is completed

I'm not looking for the email function. I don't believe it is necessary.

Ah yes I had forgotten about the sending e-mail portion of things. Let's focus just on saving after each click of the "Next" button for now.

If it is possible, it would be nice to return to the survey where the user left off but this is beyond our agreement.

Since we'll be re-using the existing functionality the behavior for users that leave the site and then come back to it will be that the form will be pre-populated with their draft submission when they return to the page, but starting at page one. The current architecture of Webform would make it difficult to make them start on the same page where they left off.

With that said, the functionality I am looking for is to have the page automatically saved after pressing the "Next Page" button. The user doesn't even need to know the form is being saved.

Cool, this is definitely the easiest solution to implement. Do the options in #6 look like they are all that we need?

gwlangie’s picture

Yes Quicksketch the options in #6 is all I need. As I think about this, maybe this should be the default behavior on paged webforms.

Anyway, the default behavior is up to you. Whatever you decide. Again, I just need the data to save when moving from one page to the next.

gerald

iamjon’s picture

subcribing.

quicksketch’s picture

Status: Active » Fixed
FileSize
19.54 KB
19.84 KB

@gwlangie sponsored this feature which has resulted in the attached patch. I've already given it extensive testing and made sure it passes our existing data-integrity tests. Because this patch required changes to the fundamental way that Webform handles submissions, a few other issues were also addressed because they were nearly a side-effect of this set of changes. Most notably #834526: Keep user on the same page when saving as Draft is also corrected by this set of changes.

I've already committed this set of changes and we'll be putting out a final release after going through the current list of in queue patches.

duntuk’s picture

@quicksketch thank you for the patch.

Just a note, make sure you run update.php after applying the patch.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.