Guided Template and customizing forms
Hi guys, here's my issue:
I've created a guided template with a `mktoForm` field so the end user can just select the form they need w/t having to touch any code on the page but for the sake of UX and beauty I want any form that is used on the landing page to prevent the reload and trigger the bootstrap modal element. I managed to prevent the form refresh on submit using embedded forms in a page outside of the Marketo platform using mktoForms2.js but I'm struggling with doing this inside a template.
So far this is my code:
$("form").submit(function (e) {
e.preventDefault();
var formId = this.id; // "this" is a reference to the submitted form
MktoForms2.loadForm("//app-sjst.marketo.com", "685-KBL-765", formId, function(form) {
// Add an onSuccess handler
form.onSuccess(function(values, followUpUrl) {
// Open thank you msg on modal
$('#thankYouModal').modal();
// Return false to prevent the submission handler from taking the lead to the follow up url
return false;
});
});
Any ideas?
BTW, this is the page: Webinar test