How do I pre-fill forms?

Anonymous
Not applicable

Re: How do I pre-fill forms?

Sanford, Thank you for your tips.

I have temporarily created the solution to to put the form on a blank landing page. I have then put that landing page in an iframe on my external site.

Yes you are right, I do want the browser to pull information from the user login, which then stores the email address an ID.

I think I would have to do a db query on the form page to get the user info I need to complete the form, which I would have to turn off the pre fill mode.

This type of query I would most likely involve joining of tables, but I am no developer. I would just have to send this over to my developer and see what he says, you think?

SanfordWhiteman
Level 10 - Community Moderator

Re: How do I pre-fill forms?

Yeah, it doesn't sound like you should be using an IFrame at all.  That isn't going to gain you anything and it's just going to make it harder to access the form elements.  I'd go back to an embedded form.

If you can alter the login page, you can hook the submit process for the login form and copy the email address into a cookie using JavaScript.  This way, you don't need to make any later database calls -- you are essentially saying, "I stored the email address on Page A, and the only way someone could get to Page B is if their login is correct, so I'll assume the email address in the cookie is the same one they logged in with." 

But your dev might not like you messing with the login form, either, even just to grab the email address.  You should review the plan with him.  The principal choices are (a) you store the email address in a cookie at the time the login form is submitted (without, in theory, affecting the login process at all); (b) he sends back the email on the first page after login (so he's setting the cookie for you); or (c) he builds some kind of web service you call whenever you want to get the user's details.

Kenny_Elkington
Marketo Employee

Re: How do I pre-fill forms?

As others have noted, marketo does not do a native prefill on non-marketo pages.  I did write this dev blog post some time ago regarding the client-side implementation of prefill using REST, http://developers.marketo.com/blog/external-page-prefill/​.  I'll look into a new post providing some server-side examples for this in the next few weeks as well.