2

我们正在使用一个脚本,该脚本允许我们动态更改表单的后续 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;
    });
  });// ]]>

4

2 回答 2

0

使用document.getElementById('iframe_id').src(给定一个 id 为 'iframe_id' 的 iframe):

location.href = "http://solutions.healthcaresource.com/2346-staff-assessment-thank-you.html";

对此

document.getElementById('iframe_id').src = "http://solutions.healthcaresource.com/2346-staff-assessment-thank-you.html";
于 2015-05-14T21:27:14.270 回答
0

您可以添加 Marketo 变量以提供动态跟进链接。

为变量添加以下元数据,并在脚本中使用它。您的登录页面中的代码将是这样的。

<meta class="mktoString" id="ThankyouPage" mktoName="Follow-up Page" default="Add dynamic followup page here" allowHtml="false">  

<script>
    MktoForms2.whenReady(function (form) {
    form.onSuccess(function(values, followUpUrl) {       
        location.href = ${ThankyouPage};
        return false;
    });
    });
    </script>
于 2016-03-31T10:32:09.580 回答