Submitting lpID with embedded 2.0 Form | Community
Skip to main content
December 4, 2014
Solved

Submitting lpID with embedded 2.0 Form

  • December 4, 2014
  • 2 replies
  • 1431 views

We're using the Marketo-generated embed code and pulling the lpID from the POST array on submit. In the 1.0 embed instructions, you just set its value to -1:
https://community.marketo.com/MarketoResource?id=kA650000000GvdjCAC

However, since the 2.0 version is built from a JSON object that is missing the lpID field, this presents a problem. I've tried the following to no avail:

        <form id="mktoForm_xxxx" name="mktoForm_xxxxx"></form><script type="text/javascript">
            MktoForms2.loadForm("//app-ab02.marketo.com", "xxx-xxx-xxx", xxxx, function(form){
                $('form').append('<input type="hidden" name="lpId" value="-1" />');
            });

When this is submitted, lpID is missing from the post:



When the same form is added to a Marketo LP and submitted, lpId is present:



Any idea how we can get that value into the post?

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 Kenny_Elkington
Hey Charlie,

You'll want to use the addHiddenFields method of the form like so:

 MktoForms2.loadForm("//app-ab02.marketo.com", "xxx-xxx-xxx", xxxx, function(form){
               form.addHiddenFields({"lpId":9999});
            });

2 replies

Kenny_Elkington
Adobe Employee
Kenny_ElkingtonAdobe EmployeeAccepted solution
Adobe Employee
December 4, 2014
Hey Charlie,

You'll want to use the addHiddenFields method of the form like so:

 MktoForms2.loadForm("//app-ab02.marketo.com", "xxx-xxx-xxx", xxxx, function(form){
               form.addHiddenFields({"lpId":9999});
            });
December 4, 2014
Thanks!