Forwarded emails prefill 2-step form with original recipient's information | Community
Skip to main content
Naor_Chazan3
Level 2
July 8, 2020
Solved

Forwarded emails prefill 2-step form with original recipient's information

  • July 8, 2020
  • 1 reply
  • 1444 views

I have webinars which use a 2 landing page/2 form registration process. 

 

Form 1 is just an email address

Form 2 contains 4 additional fields

 

Yes I know there's JS to do this on a single LP but we have 2 different styled LPs for this 2-step process so here we are. 

 

On Form 2, email field is hidden with prefill turned on. So far this is working fine, BUT there's a problem when someone clicks through the email invite which has been forwarded to them. 

 

In Form 1 they enter THEIR email address, but somehow when they get to Form 2, the hidden "email" field gets populated with the original recipient's email address. What ends up happening is this new recipient is now updating the original recipient's information with their own. 

 

Is there a way to pass the new email entered in FORM 1 to the hidden field in FORM 2? 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

Sure, pass the Email Address to the Thank You URL.

MktoForms2.whenReady(function(mktoForm){ form.onSuccess(function(submittedValues,thankYouURL){ var thankYouLoc = document.createElement("a"); thankYouLoc.href = thankYouURL; thankYouLoc.search += "&Email=" + encodeURIComponent(submittedValues.Email); document.location = thankYouLoc; return false; }); });

 

Of course you need to merge this code w/any other custom Forms 2.0 JS, in case you're already doing something else on success.

 

Then fill the Hidden Email field from the corresponding query param Email (don't use Pre-Fill).

1 reply

SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
July 8, 2020

Sure, pass the Email Address to the Thank You URL.

MktoForms2.whenReady(function(mktoForm){ form.onSuccess(function(submittedValues,thankYouURL){ var thankYouLoc = document.createElement("a"); thankYouLoc.href = thankYouURL; thankYouLoc.search += "&Email=" + encodeURIComponent(submittedValues.Email); document.location = thankYouLoc; return false; }); });

 

Of course you need to merge this code w/any other custom Forms 2.0 JS, in case you're already doing something else on success.

 

Then fill the Hidden Email field from the corresponding query param Email (don't use Pre-Fill).