1 Reply Latest reply on Aug 1, 2016 11:03 AM by Sanford Whiteman

    Lightbox not pre-filling -- on Marketo page

    JD Nelson

      I put a lightbox embed code for the onclick of a button, but the lightbox form isn't pre-filling known users. I understand why it doesn't on pre-fill on non-marketo pages, but hoping I can add something to the code to pull in some info?  Thanks in advance.

       

      <button onclick="

          MktoForms2.loadForm("//app-ab11.marketo.com", "{{mkto ID}}", {{form#}},

          function (form){MktoForms2.lightbox(form).show();});">

      CLICK HERE

      </button>

        • Re: Lightbox not pre-filling -- on Marketo page
          Sanford Whiteman

          When you use the embed code on a Marketo page, you are bypassing the Marketo named form element, thus Marketo does not include the form prefill fields (your JS block might as well be any old JS -- Marketo doesn't seek to inspect it for Marketo-like stuff, nor should they).

           

          While you can easily simulate prefill by using tokens (see my comment on Form Pre-Fill Enabled for Form Embed Codes) I don't see why you're not using a form element here.  You can pop up the lightbox even with a form element.

           

          MktoForms2.whenReady(function(form){
            MktoForms2.lightbox(form).show();
          });
          

           

          I also strongly recommend you add this CSS whenever you use the lightbox feature:

           

          .mktoForm {
            visibility: hidden;
          }
          .mktoModal .mktoForm {
            visibility: visible;
          }