Form within a form pre-fill | Community
Skip to main content
New Participant
July 13, 2022
Solved

Form within a form pre-fill

  • July 13, 2022
  • 1 reply
  • 2717 views

I have an English preferences center form (form 1) that has pre-fill enabled and is behaving as it should. On this same form, I link to the French version of the preferences center form (form 2) and when you click to access form 2, there is no pre-fill. Does anyone know how to have the pre-fill from form 1 carry over to form 2?

 

Thanks!

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

You need to attach the original mkt_tok value to the link. Marketo’s default Pre-Fill relies on the mkt_tok.

 

e.g.

MktoForms2.whenReady(function(mktoForm){ let formEl = mktoForm.getFormElem()[0], frenchVersionLink = formEl.querySelector("a#page-french"); frenchVersionLink.search += ( frenchVersionLink.search ? "&" : "" ) + "mkt_tok=" + window.__mktTokVal; });

 

Where the link has the corresponding id:

<a id="page-french" href="https://lp.example.com/preferences-french.html">Visiter page...</a>

 

1 reply

SanfordWhiteman
New Participant
July 13, 2022

We’re lacking some detail here. When you say you “link” to the French version, is that another LP under a different private domain? What exactly does the “link” entail?

KhyraAuthor
New Participant
July 13, 2022

Thanks for the prompt reply! Let me try and re-word: form 1 is my English facing preferences center used on Marketo LP 1. Within this English preferences center, there is a CTA which redirects to the French facing preferences center, which is form 2 hosted on Marketo LP 2. Both forms have pre-fill enabled. I want to know if its possible to have the pre-fill info from form/ Marketo LP 1 carry over to form/Marketo LP 2 when you click through?

form/LP 1

form/LP 2

 

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
July 13, 2022

You need to attach the original mkt_tok value to the link. Marketo’s default Pre-Fill relies on the mkt_tok.

 

e.g.

MktoForms2.whenReady(function(mktoForm){ let formEl = mktoForm.getFormElem()[0], frenchVersionLink = formEl.querySelector("a#page-french"); frenchVersionLink.search += ( frenchVersionLink.search ? "&" : "" ) + "mkt_tok=" + window.__mktTokVal; });

 

Where the link has the corresponding id:

<a id="page-french" href="https://lp.example.com/preferences-french.html">Visiter page...</a>