Home
/
Admin
/
OM Custom Marketo form example
Duplicate Snippet
Embed Snippet on Your Site
OM Custom Marketo form example
universal | |
| <script src="//app-aba.marketo.com/js/forms2/js/forms2.min.js"></script>
|
| <form id="mktoForm_#####"></form>
|
| <script>
|
| MktoForms2.loadForm("//app-aba.marketo.com", "###-LLL-###", #####, function(form) {
|
| var formEl = form.getFormElem()[0];
|
| var submitEl = formEl.querySelector('button[type="submit"]');
|
| form.onSuccess(function(values, followUpUrl) {
|
| // Get the form's jQuery element and hide it
|
| form.getFormElem().hide();
|
|
|
| // Trigger a conversion of the form
|
| om{{id}}.Listeners.convert();
|
|
|
| // Show Success view
|
| // Remove if you prefer to close the campaign or redirect on submission
|
| om{{id}}.changeView('success');
|
|
|
| // Close the campaign
|
| // Remove if you prefer to show the success view or redirect on submission
|
| om{{id}}.startClose();
|
|
|
| // Return false to prevent the submission handler from taking the lead to the follow up url
|
| // Remove if you want to redirect the visitor as configured in the Marketo form builder
|
| return false;
|
| });
|
| });
|
| </script>
|
| |
| |
Comments