Re: Does Anyone has experience to do "Form Prefill" by custom code ?

Anonymous
Not applicable

Does Anyone has experience to do "Form Prefill" by custom code ?

Hi,

We are using Form 2.0 and embed the form by means of embeded code per this article : https://community.marketo.com/MarketoArticle?id=kA050000000LHD3CAO

With this approach, we lose Form Prefill feature since we are not using landing page. But I have a hope that we can do by using custom code. Does Anyone has experience to do "Form Prefill" by custom code ? Any examples to share is highly appreciated.

Thank you in advance.
Regards,
Taworn
Tags (1)
3 REPLIES 3
Anonymous
Not applicable

Re: Does Anyone has experience to do "Form Prefill" by custom code ?

This would require use of a Marketo API to fetch the user data and populate the form. Would most likely need a programmer to setup such an experience and the languages used to write the code can vary depending on your infrastructure.
Anonymous
Not applicable

Re: Does Anyone has experience to do "Form Prefill" by custom code ?

Hi Taworn,

Is there a reason you cannot use the form embedded on a Marketo Landing Page that loads into the destination site within an iFrame?

The only way I can think of to do it with the embed form code is to have a hidden iFrame element also present on the page, containing another version of the form (which does support prefill), and copy the values over when the form initializes.

Since you'll run into the XSS security features of a browser trying to script an iFrame, you need to implement message handlers on both the main site and within the iFrame (they can pass messages and responses, just can't script each other directly). There is a pretty decent tutorial here: http://javascript.info/tutorial/cross-window-messaging-with-postmessage

I don't know of any way to do this without actually including an iFrame'd version of the form on the page, hidden or not.
Anonymous
Not applicable

Re: Does Anyone has experience to do "Form Prefill" by custom code ?

Please see the code in this repo:
https://github.com/mozz100/marketo-whodat

It was developed by a third-party developer. It allows you to fetch info about the currently-browsing user. You could use this to pre-fill the form.

Let me know if this helps?