A newer version of

Freeform

is available.

Try Freeform 5 now →

Freeform Freeform for Craft

User Guides

Displaying Submission Data from Previous Pages

When using multi-page forms, if you'd like to display submission data from previous pages on your last for page (or any page), you can do this by using an HTML block field with some Twig code.

Instructions

  • Go to the Form Builder Settings page in the Freeform settings area.
  • To enable Twig for HTML blocks, toggle on the Allow Twig to be Enabled for each HTML block? setting. You can also decide now if you need to enable to the Render HTML block Twig in isolated mode? setting as well (which when enabled, only allows the Freeform 'form' and 'fields' variables to be available. If you need the rest of Craft's variables available, you'll need to disable this setting).
  • Go into your form inside the Form Builder.
  • Add an HTML block field to the last page (or desired page).
  • Check off the Allow Twig checkbox in the property editor column for that field.

Insert some code to retrieve the previous pages' field data.

For example:

<ul>
    <li>Name: {{ form.get('firstName').value }} {{ form.get('lastName').value }}</li>
    <li>Email: {{ form.get('email').valueAsString }}</li>
    <li>Home Phone: {{ form.get('homePhone').value }}</li>
    <li>My Radio Field: {{ form.get('myRadioField').value }}</li>
</ul>
1
2
3
4
5
6
Finished!

TIP

This may typically be used as a "Confirmation" page (final page) in a multi-page form before submitting the form. However, these will parse at any point as long as there has been an initial submit (to next page or failed attempt at completing the form).