Re: Using local tokens in forms 2.0

Dan_Stevens_
Level 10 - Champion Alumni

Using local tokens in forms 2.0

Many of our forms for events, include custom disclaimers that indicate the value of the event and the contact email.  Rather than create separate forms for all of our events, I'd prefer to create a single form and use a local token to populate the custom disclaimer (rich-text) field within the form.  But when I do that, the form does not appear anymore on the landing page.  Are local tokens supported in Forms 2.0?

0EM50000000RpKK.jpg
Tags (1)
22 REPLIES 22
Anonymous
Not applicable

Re: Using local tokens in forms 2.0

Also interested in knowing. I have a hidden field that I would like populated with a token.
TJ
Grégoire_Miche2
Level 10

Re: Using local tokens in forms 2.0

Hi Ted,

You will like this idea :

-Greg

Alok_Ramsisaria
Level 10

Re: Using local tokens in forms 2.0

Hi Dan,

Yes, definitely local tokens are supported in Form 2.0, even the universal tokens that you would create in a universal parent folder in Marketo.

If you're using a rich text field with multiple lines content in the form, for instance your custom disclaimers, you need to make sure that you're using a rich text type of local token (though text-only tokens will work for words and phrases). For e.g. you've created a rich-text local token called {{my.Form Disclaimer}}. You will insert your content in this token and copy its name:{{my.Form Disclaimer}} and just place in the form's rich-text field. Even if the form is present in the design studio, the token values will be displayed in the form when the page(in which the form is) is viewed in the browser.

In your case there could be an issue where the token name didn't match with the name that you've inserted in the form. You can use this single form in every marketo campaign, but make sure that the disclaimer tokens' name that you create in programs matches with the one used in the form.

If this isn't the issue, then there could be some browser cache issues, try to delete the cache and reload the page, the form should display along with the token values.

Dan_Stevens_
Level 10 - Champion Alumni

Re: Using local tokens in forms 2.0

Hi Alok Ramsisaria - I realize tokens in Forms 2.0 are supported to some extent, but you cannot use a local token in a rich-text field (regardless if the form is local or outside of the program (e.g., in Design Studio)).  We've conducted several in-depth tests and variations - it's not supported.  In fact, the form won't even be displayed when a rich-text token is placed as the value for a rich-text field.

SanfordWhiteman
Level 10 - Community Moderator

Re: Using local tokens in forms 2.0

Workaround: output the Rich Text Token inside a (hidden) HTML container, then move it inside the form in the whenReady event.

Anonymous
Not applicable

Re: Using local tokens in forms 2.0

Hey Sanford, how is this done exactly? Thank you!

Grégoire_Miche2
Level 10

Re: Using local tokens in forms 2.0

Hi Will,

In your LP, create an HTML container that you can identify easily from a JS code. Typically:

<div ID="Disclaimer" style="display:none">{{my.Form Disclaimer}}</div>

Then, you will have to add some form 2.0 code in the LP such as:

<script>

MktoForms2.whenReady(function (form) {

    // add the JS code here to move the content of the #disclaimer div into the form and unhide it

});

</script>

-Greg

Anonymous
Not applicable

Re: Using local tokens in forms 2.0

Thanks Grégoire Michel​ do you know what js code I can use to move the content.

Grégoire_Miche2
Level 10

Re: Using local tokens in forms 2.0

Hi Will,

No, I am not good enough on JS

-Greg