Hi
Ive put together a page using Drag and Drop in the Design tools and dropped in a hubspot form.
I need to change the validation message on the email field which currently says:
Please enter your business email address. This form does not accept addresses from gmail.com .
Ive looked at the developer docs about this and it looks like i need to add something like:
translations: {
en: {
forbiddenEmailDomain: "Please enter your business email address"
}
}
I have a .js file attached to this page I created, so do I literally need to add the above code into that?
Any info much appreciated
Thanks
Jools
stefen
June 16, 2020, 5:44pm
2
@Jools619 you would need use the javascript form embed and then add your translations into the options into that. It would look something like this:
<script><!--[if lte IE 8]><script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2-legacy.js"></script><![endif]--><script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"></script><script>
hbspt.forms.create({
portalId: '123456',
formId: '123456',
locale: 'en',
translations: {
en: { forbiddenEmailDomain: "Please enter your business email address" }
}
});
</script>
Thanks @stefen
Yes that worked - I just needed to add a HTML block with that code snippet into the Drag and Drop template
I am no developer, how would I add this code snippet to the form? Do I need to do it for all forms, pelase?
stefen
April 17, 2023, 6:05pm
5
You add this into an HTML area. This will embed the form on the page with said customizations. In other words, you use this embed code instead of the Form Module or Block.