Hello,
I have a Marketo form embedded on a popup in our site, using a Wordpress plugin (popup maker). When someone submits the form, I'd like the popup to close and stay on the current page. I'm basically trying to do the same thing here: http://developers.marketo.com/blog/hide-lightbox-after-form-submission/ but instead of using the marketo lightbox, I'm embedding the form in our own popup. Has anyone tried/done this?
Thanks,
Kat
Of course: just call your popup/lightbox library's close method in MktoForms2.onSuccess.
I tried that but the form it's still doing whatever I set up on my form inside Marketo. This is my code:
<script src="//app-ab19.marketo.com/js/forms2/js/forms2.min.js"></script>
<form id="mktoForm_1335"></form>
<script>MktoForms2.loadForm("//app-ab19.marketo.com", "497-SKV-262", 1335, function (form){form.onSuccess(function(){jQuery('#popmake-1310').popmake('close');});});</script>
That's a different question. If you want to suppress the default success action (that is, redirecting to the Thank You URL) then return false in onSuccess after closing the lightbox.
Ok, it worked. I was making a dumb mistake. Thank you Sanford!