Editing Marketo form tag? | Community
Skip to main content
November 7, 2017
Question

Editing Marketo form tag?

  • November 7, 2017
  • 2 replies
  • 2727 views

I need to add an attribute to our Marketo form tags that are hosted on our Wordpress site. Does anyone have experience with doing this? While Marketo Support says it's possible, they can't offer help since it now involvea Wordpress. My developer is telling me he doesn't see where he can edit the HTML of the Marketo form. I'm not finding much in the community in regards to this issue, so any insight would be appreciated!

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

2 replies

SanfordWhiteman
Level 10
November 7, 2017

What is the exact attribute you're looking to add?

Jeffrey_Anderso
Level 1
November 7, 2017

You can definitely do this with the Marketo Forms 2 API in JavaScript:

<script src="//[your-app-id].marketo.com/js/forms2/js/forms2.min.js"></script>

<script>

    MktoForms2.whenReady(function (form) {

        $("form#mktoForm_[your-form-id]").attr( "class", "coolerForm" );

    });

</script>

<script>MktoForms2.loadForm("//[your-app-id].marketo.com", "[your-id]", [your-form-id]);</script>

Kenny_Elkington
Adobe Employee
Adobe Employee
November 7, 2017

Scripting it is a bit unnecessary.  You can edit the markup  of your embed code directly, so long as you don't change the id:

<form id="mktoForm_621" yourAttribute="your value"></form>

November 7, 2017

This is exactly what we were trying to do, and he successfully figured it out. Thank you!