javascript - 自定义 Hubspot 表单错误消息(使用 react.js)
问题描述
只是想知道是否有人有使用 react.js 嵌入 Hubspot 表单的经验
我们的一个页面中嵌入了一个 hubspot 表单。
这是设置表单的当前代码组件:
<HubspotForm
portalId="xxxxxxx"
formId="xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
onSubmit={() => null}
onReady={() => this.registerListeners()}
loading={<div>Loading...</div>}
css={hubspotcss}
cssClass="hubspotForm"
/>
我要做的就是修改企业电子邮件字段的错误消息。所以我检查了https://developers.hubspot.com/docs/methods/forms/advanced_form_options
并找到自定义国际化部分来覆盖错误消息。据我所知,我需要添加以下代码:
locale="en"
translations= {
en= {
forbiddenEmailDomain= "Please enter a company email address"
}
}
但是当我编译代码时出现错误:错误'locale' is not defined no-undef
任何人都必须知道我做错了什么?非常感谢任何信息
谢谢乔尔斯
解决方案
在@Ferran Buireu 的建议之后,我发现这对我有用。
translations={{
en:{
forbiddenEmailDomain: "Please enter a company email address."
}
}}
推荐阅读
- ubuntu-19.04 - Ubuntu 19.04 错误 404 Not Found [IP: 91.189.95.83 80] apt 更新错误
- python - Django Rest Framework:将destroy与pk以外的其他参数一起使用
- logic - 无法弄清楚为什么没有交易被执行
- javascript - html 文件不会将 onclick 属性读取为字符串
- vue.js - 创建新数据后如何更新 Strapi GraphQL 缓存?
- c++ - 无法使用安装程序下载和安装某些 MinGw 软件包
- echo - zsh:括号前保留斜线
- javascript - 如果使用 d3.create() 创建附加的 SVG,则不显示
- lotus-domino - 从 Web 上的按钮调用 Lotusscript 代理时,如何添加微调器,以便在代理完成之前用户知道它正在处理?
- excel - 使用 VBA 为任何 Windows 用户配置文件打开 SAP Logon Pad