SOLVED

Add custom class to Marketo form submit

Go to solution
Erik_Heldebro2
Level 8

Hi,

I need to embed a Marketo form which has a custom class added to the form submit button to track conversions in a third-party tool. What would be the most efficient way of doing this?

Should I add a custom function for onsuccess or should is there a simple way of fixing this?

Tags (1)
1 ACCEPTED SOLUTION
SanfordWhiteman
Level 10 - Community Moderator

MktoForms2.whenReady(function(form){

var formEl = form.getFormElem()[0],

    submitEl = formEl.querySelector('input[type="submit"]');

  submitEl.className += ' om-trigger-conversion';

});

But don't expect miracles when combining two different form event models. You might need to get a developer involved. Note this clearly has the bug I mentioned above, where it triggers on an attempted submit, not on actual success.

View solution in original post

32 REPLIES 32