How to add a global form multiple forms on the same page
Hello everyone!
We're migrating from Hubspot to Marketo on the company and using Global Forms. When I have to add only one on the page, everything is fine, but there's a specific page with a tabbed interface with four forms, and I have no idea how to add the same global form multiple times there.
I know there's a solution to add the same form multiple times, but since I need to use a redirect and change the CTA text script, I am still trying to figure out what to do. Here's the code I'm using:
<form id="mktoForm_1003"></form>
<script>
MktoForms2.loadForm("//info.mail.quorum.us", "590-ATW-173", 1003, function(form){
//Add an onSuccess handler
form.onSuccess(function(values, followUpUrl) {
// Take the lead to a different page on successful submit, ignoring the form's configured followUpUrl
location.href = "https://www.youtube.com/watch?v=HjBo--1n8lI";
// Return false to prevent the submission handler continuing with its own processing
return false;
});
});
MktoForms2.onFormRender( function(form) {
var loc = document.createElement('a'); // new Location object for easier parsing
loc.href = document.referrer;
document.querySelector('.mktoButton').innerText = "Watch Webinar"
decodeURIComponent( loc.search.substring(1) ); // use the whole query string as button label, this is just a demo
});
</script>
(The script to load the forms2.min.js goes separately on the header)
Thanks in advance for any help 🙂