我正在尝试将当前页面的 url 分配给隐藏的表单字段。
有没有办法做到这一点?
对于隐藏字段的自动填充行为,您只能从以下获取值:
默认值、URL 参数、Cookie 值、Referrer 参数
但是我使用的是rest url,因此没有参数,但想将整个url保存到隐藏字段
提前致谢
和
我正在尝试将当前页面的 url 分配给隐藏的表单字段。
有没有办法做到这一点?
对于隐藏字段的自动填充行为,您只能从以下获取值:
默认值、URL 参数、Cookie 值、Referrer 参数
但是我使用的是rest url,因此没有参数,但想将整个url保存到隐藏字段
提前致谢
和
这是您可以在 Marketo 表单上的隐藏字段上设置值的方法:
MktoForms2.loadForm("//app-sjst.marketo.com", "785-UHP-775", 1057, function (form) {
// Set values for the hidden fields, "userIsAwesome" and "enrollDate"
// Note that these fields were configured in the form editor as hidden fields already
form.vals({"userIsAwesome":"true", "enrollDate":"2014-01-01"});
});
参见示例:http: //developers.marketo.com/assets/Forms2DevExamples/example7.html
来源:http: //developers.marketo.com/documentation/websites/forms-2-0/