如何将当前页面网址分配给隐藏字段 [英] How to assign current page url to hidden field

查看:124
本文介绍了如何将当前页面网址分配给隐藏字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将当前页面的url分配给隐藏的表单字段.

I am trying to assign the current page's url to a hidden form field.

有什么办法吗?

对于隐藏字段的自动填充行为,您只能从以下内容中获取价值:

For the hidden field's Autofill behaviour, you can only get value from the following:

默认值,URL参数,Cookie值,引荐来源网址参数

Default Value, URL Parameter, Cookie Value, Referrer Parameter

但是我使用的是其他网址,因此将没有参数,但希望将整个网址保存到隐藏字段中

However I am using rest urls, therefore will not have parameters, but would like to save the entire url to the hidden field

预先感谢

总和

推荐答案

这是您可以在Marketo表单上的隐藏字段上设置值的方法:

This is how you can set values on hidden fields on Marketo form:

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/

这篇关于如何将当前页面网址分配给隐藏字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆