How many times have you filled out a form and had to repeat information that you’d already entered? It’s a pain in the neck. Ever walked away from a form like that in frustration?
I have. Many of your users probably have too.
Well, you can put that frustration aside because Ninja Forms has the solution you’ve been looking for. It’s called querystrings. You can use querystrings to pass data between WordPress forms from one form to another. You can even auto-populate form fields with a referring source, a logged-in user’s name, and other info too.
In this article, we’ll share this simple technique to save your users time and effort when filling out your WordPress form and increase your conversion rate too.
An easy way to pass data between WordPress forms
Taking information that a user has entered into one form and moving it to a different form is easy with querystrings. This way, users can move directly from one form to another for any reason and have pertinent information follow them.
No more asking twice for basic information like name, email, or anything else!
Step One: Set up your starting form ( Form A ) to receive user data
The starting form is the form that will receive the initial user data. To generate this form, head to Ninja Forms > Add New > click Blank Form or Contact Us.
Once you’ve added all the form fields you need, look for the Display dropdown. Look for the Default Value field in the dropdown and add the {querstring: key} merge tag. You can add the merge tag manually ( typing ) or by selecting querystring from the merge-tag menu.
The key can be any designation that you choose, just keep it consistent, as you will be referencing that key in the next steps. Once all of your starting fields have their designated key, move on to step two.
Step Two: Set up your destination form ( Form B ) to receive data from the starting form ( Form A )
Create another form as you did in step one. This form will receive the information being sent from the starting form ( Form A ).
Next, select the specific field(s) you want to pre-populate. To do this, copy the Default Values you entered in Form A and paste them into the Default Values of this form or Form B.
In the example below, we’re setting up an email field to be pre-populated with the user’s email address that they’ve filled out previously in another form.
Step Three: Set up a redirect on Form A that will send data to the destination form or Form B.
Return to the start form ( Form A ) and add a redirect action. This will move the user from the start form (Form A ) to the destination form (Form B) once they’ve entered their info and clicked submit.
Within the redirect action, you will append a querystring containing the Key value that you used in the start form, form A. Set the value of the querystring equal to the merge tag of the field that you want to pass data from.
You can add as many values as you have fields by including an “&” symbol after each key value. If you do it right, it should look like this:
/postOrPageName/?key=value&key2=value&key3=value
This is all you need to pass data between WordPress forms!
You did it! User information will now be passed from one form to another, just like that 🤓
The effect of the steps above is that a user will enter their email address once and only once into the start form, Form A.
They submit the form and are redirected to the destination form, Form B, where the email address they entered has been pre-populated for them. You can now pass data between WordPress forms anytime you want to!
Here’s what it looks like:
If you’re new to or struggling to wrap your head around querystrings, here’s a more detailed post on the subject.
Give it a try and pass data between WordPress forms with querystrings today!
Now that you know how to pass submission data between forms, it’s your turn. Use querystrings to increase your form conversion rate, and make the form-filling process a breeze with Ninja Forms!
Stop frustrating your users with repetitive fields. Instead, use querystrings to pre-populate fields, so users don’t have to waste time filling out the same information twice. Whether it’s capturing a user’s referring source or pre-populating fields with a logged-in user’s information, Ninja Forms has you covered.
Say goodbye to form frustration and hello to increased conversions. Try it out now for free with our core Ninja Forms plugin.
Francis Burder says:
Hello Quay,
I have lots of forms that contain the same info that we’re capturing but for various reasons, we need the forms all separate. Is there a way to auto-populate based on info they’ve submitted previously?
Quay Morgan says:
If they’re logged in an it’s WordPress user data (or custom meta), yes! You can use merge tags: https://ninjaforms.com/docs/merge-tags/
Mark Mayo says:
How can i get the value from another ninja forms on the same page on submit?
Here’s my setup:
Both forms are created from ninjaforms.
FormTemplate #1 – no submit button.
FormTemplate #2 – with submit button and to email.
I want to get all field value from FormTemplate #1 to my to email field value at FormTemplate #2. Is there a way to do this??
Will Brooks says:
Hi Mark, I’m also looking to find a solution for this.
Did you manage to find a way to get this to work?
Mark Mayo says:
@Will Brooks – Actually I was forced to just merge and use multi-step for two templates.