Prefill forms on external pages help

Alok_Ramsisaria
Level 10

Re: Prefill forms on external pages help

Navtej Singh

Yes, it can be done with Zendesk as well. Drop me a line at alok@grazitti.com and we can discuss in detail.     

Anonymous
Not applicable

Re: Prefill forms on external pages help

Hi Alok,

I was just wondering if you had any information on how I would achieve form prefills where the form is sitting within wordpress. I have found myself in the same position, being able to call and receive data but not sure how to piece it all together.

SanfordWhiteman
Level 10 - Community Moderator

Re: Prefill forms on external pages help

Not sure what you're asking, Kurt.

If you're fetching the data in PHP before the page is rendered, then the most efficient way is to export a JavaScript object into the page content in a <script> block and call the Forms API setValues method in that same inline script.

Or you can create a webservice and invoke it via XHR while/after the document content loads (preventing API slowdowns from affecting site performance) and call setValues in the callback.

Of course most such implementations are done incorrectly. (I'm skipping over the inherent DoS vulnerability for the moment and talking about how the Forms API works. For example, the plugin referenced above is implemented incorrectly on the JavaScript side and creates duplicate requests.)  So you must be diligent about order of operations and the essentially asynchronous nature of Marketo form rendering.

Anonymous
Not applicable

Re: Prefill forms on external pages help

One work around that I've done in the past is to use a Marketo form and populate it on the landing page via an iframe. It's not an ideal solution, but it allows you to use the pre-fill functionality of a Marketo form on the page that you desire, without the security concerns.

SanfordWhiteman
Level 10 - Community Moderator

Re: Prefill forms on external pages help

This is a much more reasonable solution than people give it credit for -- I'd much rather see IFRAMEs than these other fragile solutions.