Add custom script tags to Marketo forms? | Community
Skip to main content
June 6, 2016
Question

Add custom script tags to Marketo forms?

  • June 6, 2016
  • 4 replies
  • 3261 views

Hi, is there a way to add java script code to Marketo forms easily?

Example format:

<script type="text/javascript"></script>

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

4 replies

Jim_Thao7
Level 8
June 6, 2016

Is there a specific need?

You can add JS to any landing page to target form elements if needed.

Robb_Barrett
Level 10
June 6, 2016
pavel_plachky
Level 5
June 6, 2016

Hello Ryan,

as Jim noted, adding Javascript is possible. There are a few ways to do it.

1. Add HTML block to your landing page

2. Add the script to your landing page template

3. Use a token in your landing page template and set the token value in a program containing the landing page.

I hope it helps

Pavel

SanfordWhiteman
Level 10
June 6, 2016

Ryan, pay very close attention to the manual Robb linked to.  You must use the Marketo Forms 2.0 event model to enhance Marketo forms.   While an experienced JS programmer will have no trouble waiting for events, attempting to skip proper event handling -- or to treat forms like raw HTML forms -- will fail, and you'll lose leads and/or make your forms unusable. There are commercial "data enrichment" form plugins that make these same mistakes with Marketo forms. Respect the framework, though, and you'll be fine!