How do you read a cookie value into an embedded form field?

Anonymous
Not applicable

How do you read a cookie value into an embedded form field?

We have been using iframes to display our Marketo forms, but recently needed to embed one on an external page.  I followed the instructions on the Put a Marketo Form on a Non-Marketo Page help article, and a great discussion, Easiest way to Embed Marketo forms onto our Webpage, where Adam Waterson provided an example landing page that revealed a few additional style sections and scripts he included that were not shown in the help article that resulted in a perfect format, and working profiling and pre-fill despite the help article's assetion to the contrary.

Unfortunately the form's hidden fields that would populate with cookie values when the form is in Marketo are not being populated when using the embedded form :0(  We have javascript on the page that defines a getCookie (name) function to read the cookie values, but I can't figure out to use that in conjunction with the "value=" portion of the field definition HTML below - does anyone know what that token should be?

<li class='mktField' style="display: none;"><label>utm_medium:</label><span class='mktInput'><input class='mktFormHidden' name="utm_medium" id="utm_medium" type='hidden' value="[token/function call]" /><span class='mktFormMsg'></span></span></li>
Tags (1)
2 REPLIES 2
Anonymous
Not applicable

Re: How do you read a cookie value into an embedded form field?

Hey Elliot. Can you check your javascript code & make sure that the script is referring to "parent" and "child"... I believe that becuse you're using an iFrame it's only looking for parameters in the source of the iframe URL. Instead you need to tell it to search in the parent's url instead.
Anonymous
Not applicable

Re: How do you read a cookie value into an embedded form field?

Thanks Adam, we removed the iframe statement, and replaced it with the embedded form code.  The example you provided didn't appear to have hidden fields that were reading their value from a cookie.  Do you have such an example?