SOLVED

Re: Form is not Pre-Filling lead data

Go to solution
Andy_Weilbaeche
Level 1

Form is not Pre-Filling lead data

I'm trying to set up an Email Subscription Center but I'm running into pre-filling issues.

My Setup:

Guided Landing Page:

- Holds Header, Footer, and form# variable which controls which form is shown.

- Form is initialized here with the following code:

<div class="contest-form">

  <script src="//app-ab13.marketo.com/js/forms2/js/forms2.min.js"></script>

  <form id="mktoForm_${formID}"></form>

  <div id="confirmform" style="display:none">hello</div>

  <script>

  MktoForms2.loadForm("//app-ab13.marketo.com", "204-HUD-558", ${formID}, function ( form ){

    form.onSuccess(function() { 

      document.getElementById('confirmform').style.display= 'block';

      document.getElementById('confirmform').style.visibility= 'visible';

      return false; 

    }); 

  });

  </script>

</div>

Landing Page:

- Form variable is entered here and (if the form # exists) the form is displayed on the landing page.

Form:

- Subscription center fields.

- Form Pre-Fill is enabled on all fields.

Issues:

1. When visiting the landing page, the form is not pre-filling on the landing page.

2. Trying to use a token at the top of a form doesn't even fill in the default value: Hello, {{lead.Email Address:default=yo}} is displayed instead of the actual lead Email address or the default of "yo" I have tried removing the space between Email Address with the same result.

Am I initializing the form incorrectly in the root Guided Landing Page Template?

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Form is not Pre-Filling lead data

OK. The reason this is happening is Pre-Fill is only natively supported with named mktoForm elements. When you use the form embed code on a Marketo LP, it's treated the same as an external page, ergo Pre-Fill is disabled.

View solution in original post

4 REPLIES 4
SanfordWhiteman
Level 10 - Community Moderator

Re: Form is not Pre-Filling lead data

Please move the thread to Products and I'll answer there (this space is for discussing the Champs program itself). Move link is at the right.

Andy_Weilbaeche
Level 1

Re: Form is not Pre-Filling lead data

Moved. Thank you.

SanfordWhiteman
Level 10 - Community Moderator

Re: Form is not Pre-Filling lead data

OK. The reason this is happening is Pre-Fill is only natively supported with named mktoForm elements. When you use the form embed code on a Marketo LP, it's treated the same as an external page, ergo Pre-Fill is disabled.

Andy_Weilbaeche
Level 1

Re: Form is not Pre-Filling lead data

Thanks a lot Sanford. I was unaware of that but assumed the form initialization was causing my issue.

The token above is now working, so I'll move forward and hopefully everything else will fall into place.

Thanks again.