Introduction

In this article you’re going to learn how to reuse a single GravityForms form on multiple pages by pre-populating the dropdown field value based on the corresponding page where you’ve embedded the form.

When is this method useful?

Let’s say you’re selling several plugins on your website.

Each plugin has its own page and its own contact form on that page in case anybody needs to reach out for pre-sales questions or support.

Instead of creating a separate contact form for each plugin, you can add a parameter to a single “master” contact form, and dynamically populate the form on your page to preselect a dropdown to refer to that particular plugin or page.

Additionally, you will have all of your GravityForm submission entries in the same place and your GravityForms dashboard won’t be a mess of dozens of contact forms.

We use this exact setup on our site and this tutorial will show you how to do it on yours. 🙂

Example Gravity Form

Here’s the actual contact form we have on our Contact Us page, which routes requests to different places—e.g. our help desk, or my email address, etc.,—according to which options the visitor selects.

Related: How to create tickets in FreshDesk using GravityForms

Requirements

1 – GravityForms

Setting up dynamic population on your Gravity Form

1 – Go to WordPress Dashboard > Forms > Open the form that will be updated.

2 – Click the field that will be automatically populated.

3 – Click Advanced then enable the “Allow field to be populated dynamically” checkbox option.

Advanced dynamically populated - Use One Gravity Form on multiple pages via prepopulation

4 – Add a value to the “Parameter Name” field, in this case we have used plugin_name but you can use anything.

When this step is completed it means the Plugin support field will be automatically populated from the shortcode.

Shortcode usage

We have used this short code for our MemberMouse Advanced Decision Shortcodes plugin page:

The field_values parameter crucial for the shortcode because that part populates the parameter with information. 

As you can see in the image below, the Plugin support and MemberMouse Advanced Decision Shortcodes item is selected by default when the user visits this page: https://memberfix.rocks/membermouse-advanced-decision-shortcodes/

Dynamic populate - Use One Gravity Form on multiple pages via prepopulation

gravityforms id=”42″ title=”false” description=”false” field_values=”my_situation=2&plugin_name=MemberMouse Advanced Decision Shortcodes”

Note: Make sure to add the brackets [ and at the start and at the end as shown in the screenshot above.

Additionally, change the value as you need.

Results

Voila! Your gravity forms fields are automatically populated from the shortcode and are unique on each service even though you are using the same contact form.

What do you think of this tutorial?

Article Title: How to re-use gravity forms for multiple pages by pre-populating fields?

Short Description: How to re-use gravity forms for multiple pages by pre-populating fields?

Author: Ardian Lumi

Publisher - Orgnization: MemberFix

Publisher Logo: mermberfix logo x200 1 - Use One Gravity Form on multiple pages via prepopulation

User Review
5 (1 vote)

 

R

Now let’s hear from you!

Are pre-populating the fields automatically in Gravity Forms ?

Is this article helpful for you?

Tell us in the comments section below.

Share This