Hola! ¡Tenemos nuestra Comunidad en Español!

Embedded HubSpot Forms Throwing 400 (Bad Request) Error

Highlighted
Esteemed Contributor | Diamond Partner

I've noticed that for whatever reason the hbspt.forms.create method is throwing a 400 error whenever I embed a form.

 

The request is to fonts.google.com - which shouldn't be happening anyways - I have all the form styling options disabled on the form.

 

Screen Shot 2019-02-05 at 7.55.19 AM.png

 

This also only seems to happen on HubSpot COS/CMS pages.

 

Can you shed some light here? When the form styles and css options are removed from my form embed codes and settings I expect them to not attempt to load extra overhead for styling purposes.

Reply
0 Upvotes
4 Replies 4
Community Manager

Hi @derekcavaliero,

 

Have you reached out to HubSpot Technical Support regarding this? If you are seeing something that is not working as expected, I would recommend reaching out to Support, as that will be the most direct way to resolve this issue in your portal.

 

Thank you,
Jenny


Did my post help answer your query? Help the Community by marking it as a solution
Reply
0 Upvotes
Regular Contributor

i can confirm the same behavior on our hubspot landing pages and whenever we embed hubspot forms onto our website. Did you get any feedback before i open an new issue with technical?

Reply
0 Upvotes
Esteemed Contributor | Diamond Partner

@lhaith 

 

I didn't have time to wait to resolve the issue with a support ticket but I did come up with a (hacky) solution that fixes it.

 

The code below will override the method that is responsible for outputting the HubSpot form CSS (and in this case the external request to Google Fonts). This would need to be placed after the forms library, but BEFORE your HubSpot Embed Code. 

 

<script>
hubspot.utils.injectCss = function() { return false; };
</script>

I intend to open up a support ticket if I see the issue happening again during my next LP build.

Reply
0 Upvotes
Regular Contributor

@derekcavaliero 

 

Hopefully you get somewhere with that ticket. Thanks for sharing the temporary solution. i'll get our developer on it straight away. Smiley Happy

Reply
0 Upvotes