Hi All,
We had an issue with form submission, we have taken your blog as reference for submitting the lead in other instance. It's really super helpful. Thanks for providing this.
<script src="https://app-abm.marketo.com/js/forms2/js/forms2.min.js"></script>
<script>
var mktoFormsLibs2 = {};
mktoFormsLibs2["app-abm"] = MktoForms2;
delete MktoForms2;
</script>
<script src="https://app-ab32.marketo.com/js/forms2/js/forms2.min.js"></script>
<script>
var mktoFormsLibs1 = {};
mktoFormsLibs1["app-ab32"] = MktoForms2;
</script>
<form id="mktoForm_2709"></form>
<form id="mktoForm_1133" style="display:none"></form>
<script>mktoFormsLibs2["app-abm"].loadForm("https://app-abm.marketo.com", "980-EGK-205", 1133); </script>
<script>mktoFormsLibs1["app-ab32"].loadForm("https://app-ab32.marketo.com", "969-NVR-362", 2709, function (form)
{
form.onValidate(function()
{
var svals = form.vals();
if (svals.SBU__c == "SPS")
{
form.submittable(true);
}
else
{
form.submittable(false);
mktoFormsLibs2["app-abm"].whenReady(function(HSMform)
{
HSMform.addHiddenFields({"LeadSource" : "Web Form",
"MarketoBU__c" : "HSM",
});
HSMform.submit();
form.onSuccess(function(values, ThankYouURL) {
document.location.href = 'ThankYouURL';
return false;
});
});
}
});
});
</script>
Kindly verify and let me know if you need any additional information.
Thanks,
Mahesh