Embed code for Form doesn't work

SOLVE
Highlighted
New Contributor

I created this form:

 

<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/shell.js"></script>
<script>
  hbspt.forms.create({
 portalId: "1837750",
 formId: "40e957e2-0e67-4ec0-b903-c304fa532af6"
});
</script>

 

However, when trying to embed the form using HTML, it doesn't seem to work and just shows a blank screen.

I tried using this website as well to test the code just in case, but it doesn't work either.

http://www.csgnetwork.com/htmlcodetest.html

 

The regular URL for this form does work however

https://share.hsforms.com/1QOlX4g5nTsC5A8ME-lMq9g13e0m

 

Any ideas what's wrong with the embed code? I just copy/pasted it? Anyone else experiencing this?

 

Thanks

 

Jacov

1 Accepted solution

Accepted Solutions
Advisor

Hi @jacovm,

 

The only thing that seems to be missing from this forms code is the IE 8 compatability script, which should look something like this:

 

<!--[if lte IE 8]>
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/shell-legacy.js"></script>
<![endif]-->

 

The other possibility is that your website host is blocking the Javascript from functioning correctly, some hosts (including WordPress.com) won't allow Javascript to function.

 

If this doesn't help, I'd suggest reaching out to your web host's support group or HubSpot support for help.

 

Good Luck!

 

Trevor

-Trevor

If my post resolves your issue, please accept my post as a solution.
Reply
0 Upvotes
4 Replies 4
Advisor

Hi @jacovm,

 

The only thing that seems to be missing from this forms code is the IE 8 compatability script, which should look something like this:

 

<!--[if lte IE 8]>
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/shell-legacy.js"></script>
<![endif]-->

 

The other possibility is that your website host is blocking the Javascript from functioning correctly, some hosts (including WordPress.com) won't allow Javascript to function.

 

If this doesn't help, I'd suggest reaching out to your web host's support group or HubSpot support for help.

 

Good Luck!

 

Trevor

-Trevor

If my post resolves your issue, please accept my post as a solution.
Reply
0 Upvotes
New Contributor

Thanks @trevorjones71

 

Yes, it did seem like an issue with the code on our website. Adding a <div> tag resolved this.

 

Thanks for the help.

 

Jacov

Advisor

Interesting to here that <div> tags helped.  You might look at the other code on the page to see if there is a place where a you are missing a </script> tag.

-Trevor

If my post resolves your issue, please accept my post as a solution.
Reply
0 Upvotes
New Contributor
This worked like a charm for using Hubspot forms in the new Google Sites, and it took me a while to get here, so thank you a lot!
Reply
0 Upvotes