Pre fill hidden form field based on hidden value on a page

Highlighted
Anonymous
Not applicable

Pre fill hidden form field based on hidden value on a page

We're creating a website which will have user profiles. On each profile created will use the same Marketo form. We don't want to use URL parameters, cookie value or referrer parameters but want to be able to pull a hidden id value from the page and insert it into the hidden form field.  What's the bast way?

Cheers,

Pieter
Tags (1)
2 REPLIES 2
Highlighted
Level 10 - Champion Alumni

Re: Pre fill hidden form field based on hidden value on a page

URL params or a cookie would be best.

Can you describe how you assign the ID and the workflow from sign up through to Marketo?
Highlighted
Anonymous
Not applicable

Re: Pre fill hidden form field based on hidden value on a page

Work with one of our develepers and got this to work. Its the imbed code but modified. We wanted it to pull a hidden value from the page and not the URL and this works.


<script src="//app-sj05.marketo.com/js/forms2/js/forms2.js"></script>
<form id="mktoForm_1119"></form>
<script>
   MktoForms2.loadForm("//app-sj05.marketo.com",
                       "851-XTG-642",
                       1119,
                       function(form){form.setValues({"ReferrelId":document.getElementById("accountId").value})});
</script>