我们正在使用一个脚本,该脚本允许我们动态更改表单的后续 URL,因此我们可以在多个资产中使用相同的表单,但具有不同的后续页面。
问题是脚本仅在加载表单本身而不是通过可视化编辑器引入时才有效。如果我们按照开发人员网站上的说明调整代码以使其与可视化编辑器一起使用,它就会停止工作。
我们需要通过编辑器引入表单,因为我们有另一个脚本,它只适用于以这种方式加载的表单。此脚本在父窗口而不是 iframe 中打开后续页面。
你能提供任何建议吗?
这是脚本的代码:
动态跟进网址:
<script type="text/javascript">// <![CDATA[
MktoForms2.whenReady(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 = "http://solutions.healthcaresource.com/2346-staff-assessment-thank-you.html";
//return false to prevent the submission handler continuing with its own processing
return false;
});
});// ]]>