(Advanced) Pass values from a form confirmation page into another form

In this article:


Introduction

There may be occasions as you're working with LGL Forms when you want to pass user values from the confirmation page from one LGL form into another—in other words, to keep some data from a form that was already submitted and pass it into another form. An example would be selling tickets to an event and asking registrants to make a donation once they're done purchasing tickets. 

There are some good reasons for using two shorter forms instead of one long one: The data you want to capture may be too complex for one form. There are also technical limitations, such as not being able to combine recurring transactions and multiple transactions within one form.

To make life a little easier for those who are submitting your form, you can pre-populate the second form with some of the information they provided in the first form. The illustration below shows the concept: The name and email address supplied by the person in Form-1 will be passed into and then will pre-populate Form-2.

Build a confirmation page

To build the confirmation page, go to the Confirmation tab for your Form-1. You'll need to use HTML formatting to build the link that goes to your Form-2:

When creating the link to your Form-2, you will use the Publish code from your Form-2 as the destination and then add the values you want to pass through into Form-2. To do this, go to your Form-2 and click Publish.

Then select the URL in the Link to form section, as shown here:

You'll use this destination in the link you put in the confirmation page for Form-1. At the end of that destination, add a question mark and the fields you want to pass through. 

In your Form-2, the merge fields for first name, last name, and email are most likely going to be field_6, field_7, and field_9. You can confirm this by looking at the Confirmation section of your Form-2 and then looking at the merge field list on the right:

Which of the merge fields are available to pass data through?

Any field that’s available for merging in one form can have its value passed through to another form as long as the correct merge field name with the correct syntax is used. This applies to any merge field available from the menu shown in the screenshot above. 

The example below shows the URL destination followed by the part where values are being passed (see the boldface text in the HTML code shown below):

Note about special characters in submitted data

Depending on your form setup, special characters such as apostrophes or ampersands could prevent values from being passed through as expected. In these cases, the donor would be required to type in the data.


Form-2 gets pre-populated

When Form-2 comes up, it will be pre-populated with the values passed from Form-1:

Important note about credit card data

For security reasons, LGL does not store credit card information. This means that each and every form submission needs to be accompanied by credit card information that is passed directly to the payment processor. So if you use approach described in this article, even though the donor has provided their credit card information in their first submission there is no way to avoid requiring them to re-enter it in the next form.