Hi all -
Sorry for necroposting, but I've been using this functionality on my page but it's not prefilling the form. Is there a setting I need to add to get the pre-fill? The page has it enabled.
If you're using the form javascript snippets, you won't be able to use prefill. It's a security restriction for transferring data off Marketo.
Forms 2.0 JS works fine on Marketo LPs. The prefill restriction is for non-Marketo LPs.
Looks like if the form is added directly in the page, the page puts in some JS to prefill with the appropriate fields. If you use JS to call in the form, it doesn't automatically pull the LOF and prefill. The mktoPreFillFields is called automatically based on the form.
Yes, you have to use an actual form, not JS that happens to call MktoForms2::loadForm.
I was able to get it to work with this bit of code.
form.vals({"Postal Code":"{{lead.Postal Code}}",
"Phone":"{{lead.Phone Number}}",
"Country":"{{lead.Country}}",
"First Name":"{{lead.First Name}}",
"Last Name":"{{lead.Last Name}}",
"Company":"{{company.Company Name}}",
"Email":"{{lead.Email Address}}",
"City":"{{lead.City}}",
"State":"{{lead.State}}",
"Address":"{{lead.Address}}"});
Sure, that's another way to do it if you're on a Marketo LP. But I don't understand why you're using the JS instead of a true form widget. Note you lose per-LP form fillout reporting this way.