SOLVED

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

Go to solution
Naor_Chazan3
Level 2

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

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? 

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

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

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).

View solution in original post

1 REPLY 1
SanfordWhiteman
Level 10 - Community Moderator

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

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).