APIs & Integrations

fred_a
Member

blockedDomains attribute doesn't work

SOLVE

Hi

I'm trying to block some domains. The form display well but doesn't block anything... Could you please tell me what's wrong with this code?

hbspt.forms.create({
portalId: "xxxxxx",
formId: "xxxxxxxxxxxx",
css: "",
blockedDomains: ["domain1.com", "domain2.com"],
translations: {
en: {
required: "Please fill the required field.",
missingSelect: "Please select an option.",
forbiddenEmailDomain: "Please enter your business address",
manuallyBlockedEmailDomain: "Please enter your business address",
submitText: "WATCH NOW"
}
}
});

Thanks

0 Upvotes
1 Accepted solution
cbarley
Solution
HubSpot Alumni
HubSpot Alumni

blockedDomains attribute doesn't work

SOLVE

Hi @fred_a, Engineering has pushed out a fix for this issue. Can you check to see if you're able to use that parameter now?

View solution in original post

0 Upvotes
6 Replies 6
cbarley
Solution
HubSpot Alumni
HubSpot Alumni

blockedDomains attribute doesn't work

SOLVE

Hi @fred_a, Engineering has pushed out a fix for this issue. Can you check to see if you're able to use that parameter now?

0 Upvotes
fred_a
Member

blockedDomains attribute doesn't work

SOLVE

Thanks @Connor_Barley I replied in this topic: Blocked domains in form embed

0 Upvotes
cbarley
HubSpot Alumni
HubSpot Alumni

blockedDomains attribute doesn't work

SOLVE

Hi @fred_a,

I tested this a bunch in my own portal and it wasn't working at first. I then slowly deleted and re-added elements of your code. This code you sent over, and the code I used here in my portal seemed to work, but then it stopped working again. I'm going to have to keep digging into this one and update you when I have a solid answer.

fred_a
Member

blockedDomains attribute doesn't work

SOLVE

ok, strange... Thanks @Connor_Barley!

0 Upvotes
cbarley
HubSpot Alumni
HubSpot Alumni

blockedDomains attribute doesn't work

SOLVE

Hi @fred_a, looking at David's response on this thread, does removing the space between blocked domains help fix the issue?

0 Upvotes
fred_a
Member

blockedDomains attribute doesn't work

SOLVE

Thanks for your help @Connor_Barley! I tried ["domain1.com","domain2.com"] and "domain1.com,domain2.com" (without spaces) but it still doesn't work..

0 Upvotes