SOLVED

Can auto populate form field?

Go to solution
Jim_DiModica
Level 3

Can auto populate form field?

Hi -

We have a "Request Demo" form that can be accessed from all our site's product pages.

This current form, supplied by our IT department, uses a query string value, possibly coupled with JavaScript to populate the "Model You're Interested In" field.

We're interested in replacing this, and another similar form with a Marketo form, and wonder if this "auto-population" functionality can be achieved.

Thanks for any suggestions.

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Can auto populate form field?

There's no specific documentation. An example of the second approach would be this form...

pastedImage_1.png

...which has this hidden field w/AutoFill from a query param enabled...

pastedImage_2.png

...and this Rich Text field...

pastedImage_3.png

With a tiny bit of JS you can bring the hidden field into the open (as well as posting it with the form):

http://s.codepen.io/figureone/debug/6ce729cf3c85f61bd286fb41b81af5ac?ind=Construction

http://s.codepen.io/figureone/debug/6ce729cf3c85f61bd286fb41b81af5ac?ind=Medicine

View solution in original post

3 REPLIES 3
SanfordWhiteman
Level 10 - Community Moderator

Re: Can auto populate form field?

Yes. This is basic JS interpolation of query parameters (just as it is in your current form).  On a Marketo form, you have two choices: use generic JS, or use the Marketo built-in hidden field AutoFill functionality to parse the value, then unhide the value afterward.

Jim_DiModica
Level 3

Re: Can auto populate form field?

Thanks, Sanford.

Your reply affirms my suspicions that it can be accomplished with a Marketo form. The broad strokes that you supplied help me to understand the concept, however I need more granular instructions. Can you point me to documentation that might guide me through it?

Many thanks!

SanfordWhiteman
Level 10 - Community Moderator

Re: Can auto populate form field?

There's no specific documentation. An example of the second approach would be this form...

pastedImage_1.png

...which has this hidden field w/AutoFill from a query param enabled...

pastedImage_2.png

...and this Rich Text field...

pastedImage_3.png

With a tiny bit of JS you can bring the hidden field into the open (as well as posting it with the form):

http://s.codepen.io/figureone/debug/6ce729cf3c85f61bd286fb41b81af5ac?ind=Construction

http://s.codepen.io/figureone/debug/6ce729cf3c85f61bd286fb41b81af5ac?ind=Medicine

View solution in original post