Marketo Form onSuccess never fires | Community
Skip to main content
New Participant
May 11, 2022
Solved

Marketo Form onSuccess never fires

  • May 11, 2022
  • 1 reply
  • 4190 views

I have the following code to place a form.   When I fill out all the fields and submit it, I see the 'Submitting...' in the console log, but that is it.   I never see 'Submitted' and there are no errors in the console.

 

 

 

 

<html> <head> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js" integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> </head> <body> <div class="by-marketo"> <form id="mktoForm_12695"></form> </div> <script> const marketoFormsScriptTag = document.createElement('script'); marketoFormsScriptTag.src="https://now.EXAMPLE.com/js/forms2/js/forms2.min.js"; marketoFormsScriptTag.setAttribute('charset', 'utf-8'); marketoFormsScriptTag.onload = function () { window.MktoForms2.loadForm("//now.EXAMPLE.com", "XXX-XXX-XXX", 12695, function (form) { console.log('Element', form.getFormElem()); //MktoForms2.lightbox(form).show(); form.onSubmit(function () { console.log('Submitting...', form); }).onSuccess(function (values, followUpUrl) { console.log('Submitted'); form.getFormElem().hide(); form.getFormElem().parent().html('<div class="by-marketo-form-confirmation"><p>Thank you for getting in touch! We appreciate you contacting us and we will respond within two business days with more information.</p></div>'); return false; }); }); } document.head.appendChild(marketoFormsScriptTag); </script> </body> </html>

 

 

 

 

 

As far as how I generating the script tag, that is because this will eventually be in a Vue.js app.   I pulled it out in a standalone page to make sure that nothing Vue.js was conflicting with it, but I get the same behavior.


Ideas?

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

Don’t see that problem here: https://codepen.io/figureone/pen/QWQKLge/55ece5d5a62e0b2e299c82b883bbdb16

1 reply

SanfordWhiteman
New Participant
May 11, 2022

Not sure the reasons for removing those are so obvious. We need to see a page where this is failing to troubleshoot it for you.

New Participant
May 11, 2022

Updated to include the account info.

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
May 12, 2022