Lightbox Form not pre-populating

JD_Nelson
Level 10 - Community Advisor

Lightbox Form not pre-populating

I'm not sure why my form that I put in a lightbox is not pre-populating with information after coming from an email link.  I used the JS query to pop up the lightbox w/ form on click, maybe that prevents something?  My LP is set to enable pre-populating.  am I missing sometthing?

Here's the generic script I'm using:

 

<a href="#" id="lightbox-link">CONTACT US</a>

 

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

<form id="mktoForm_618">&nbsp;</form>

<script>

  var btn = document.getElementById("lightbox-link");

  btn.onclick = function(){

    MktoForms2.loadForm("//app-xxx.marketo.com", "xxx-xxx-xxx",618, function (form){

      MktoForms2.lightbox(form).show();

    });

  };

</script>

Tags (1)
1 REPLY 1
Grant_Booth
Level 10

Re: Lightbox Form not pre-populating

Hi JD,

For security reasons, forms will only prepopulate if they're dragged onto a Marketo landing page using the form editor. Forms can't prefill when using the embed code.
If you use one of our API's in conjunction with the .vals method from here:
http://developers.marketo.com/documentation/websites/forms-2-0/
you might be able to set up something custom.