We have a number of webinars that we want to gate on our website using one form in a lightbox. I would like to use one form for all webinars, and then have the follow up page go to the correct video page URL based on the link they clicked to get to the form. For example:
View Webinar A Here --> link is clicked, then lightbox form comes up. When form is filled out, they are sent to Video A
View Webinar B Here --> link is clicked, then the same lightbox form comes up. When form is filled out, they are sent to Video B
View Webinar A Here --> link is clicked, then the same lightbox form comes up. When form is filled out, they are sent to Video A
I don't see how to do this. Can it be done? I feel like it's an easy solution, but my brain can't figure it out today! I would hate to have to do a different form for each webinar.
Thank you!
This has been documented here on the forums. Please search.
I do not necessarily recommend this system because it has to be updated frequently.
There's an alternative where you can use the same Form, but it effectively lives on a separate page, but javascript or an iframe may need to be used.
If you have a web dev, I think this would work better with javascript.
Thanks Josh! I did search as much as I could and didn't run across anything that did what I wanted.
<a href='#A' class="webinar-link">A</a>
<a href='#B' class="webinar-link">B</a>
<a href='#C' class="webinar-link">C</a>
<form id="mktoForm_1234" class="mktoForm"></form>
<script>
[].forEach.call(document.querySelectorAll('.webinar-link'), function(link) {
link.addEventListener('click', function(e) {
var variantClicked = this.hash.substring(1);
MktoForms2.loadForm("//app-xx-yy.marketo.com", "AAA-BBB-CCC", 1234, function(form) {
MktoForms2.lightbox(form).show();
form.onSuccess(function(vals, tyURL) {
alert('You clicked link ' + variantClicked);
return false;
});
});
e.preventDefault();
});
});
</script>
Thank you Sanford!