【发布时间】:2021-06-10 11:33:41
【问题描述】:
我在我的 wordpress 网站中嵌入了一个 hubspot 表单,我需要在加载表单时运行一段脚本。这是要求,但我遇到了一个错误,它在控制台中显示如下。
Hubspot Form: There was an error when running your onFormReady function
我的 hubspot 代码是:
<script>
hbspt.forms.create({
region: "xxxxx",
portalId: "xxxxxxx",
formId: "xxxxxxxxxxxxxxxxx",
onFormSubmit: function($form) {
console.log("form is submitted already");
//some other stuff as well
jQuery('.hubspot_form_outer_class').hide();
},
onFormReady: function($form) {
console.log("success");
$("div.input > select").attr("disabled", "disabled");
}
});
</script>
这里onFormSubmit 函数工作正常(其中的jQuery 脚本也没有问题),但函数onFormReady 不起作用。我只需要使这个功能工作。
这里有什么问题?有人有想法吗?非常感谢任何帮助/信息。
谢谢。
更新:jQuery("div.input > select"); 的控制台输出
【问题讨论】:
标签: jquery wordpress hubspot-crm