Editing Marketo form tag?

Highlighted
Anonymous
Not applicable

Editing Marketo form tag?

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!

4 REPLIES 4
Highlighted
Level 10 - Community Moderator

Re: Editing Marketo form tag?

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

Highlighted

Re: Editing Marketo form tag?

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>

Highlighted
Marketo Employee

Re: Editing Marketo form tag?

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>

Highlighted
Anonymous
Not applicable

Re: Editing Marketo form tag?

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