Embed code for Form doesn't work

SOLVE
jacovm
Member

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
trevorjones71
Solution
Key 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.

View solution in original post

0 Upvotes
12 Replies 12
trevorjones71
Solution
Key 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.

View solution in original post

0 Upvotes
jacovm
Member

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

trevorjones71
Key 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.
0 Upvotes
tomshawver360md
Participant

This solved it for me as well! To make forms work on Google Sites, just type 

<div>

before the Hubspot embed code, and type

</div>

after the embed code. Boom, now it loads.

sharonlicari
Community Manager

Thank you for sharing @tomshawver360md 


¿Sabías que la Comunidad está disponible en Español?
¡Participa hoy en conversaciones en el idioma de tu preferencia,cambiando el idioma en tus configuraciones!

Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !


0 Upvotes
icastrocr
Participant
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!
0 Upvotes
ACD
Participant

Hi guys,

 

Sorry, I'm poor with coding. How exactly did you add the div code to the html to resolve this? I'm having an issue with the embeded code showing on my Google Sites. 

 

 

0 Upvotes
julianalvarezk
Member

Hi @jacovm ,

 

I had the same issue, after hours of debbuging I've found that the HTML code is missing the HTTPS:, that's why It didn't work for me.

 

The actual code is:

 

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

 

Please tag this as a solution if It worked for You, I haven't found this solution in any forum.

 

Greets.

fzubiran
Member

I have de same problem it apears as a blank space, my actual code is:

 

<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/shell.js"></script>
<script>
  hbspt.forms.create({
portalId: "7462782",
formId: "e71c7040-572b-4e7b-ad10-6b2c12edb69c"
});
</script>
 
what do i have to put in order to make it work
0 Upvotes
julianalvarezk
Member

Hi!

It seems to me that you have the same problem i did. Note that the src parameter is missing the protocol (HTTPS), that's why the form wasn't loading for me.

 

Try replacing your code with this:

 

<script charset="utf-8" type="text/javascript" src="https://js.hsforms.net/forms/shell.js"></script>
<script>
  hbspt.forms.create({
portalId: "7462782",
formId: "e71c7040-572b-4e7b-ad10-6b2c12edb69c"
});
</script>
0 Upvotes
fzubiran
Member

thanks for the tip it still doesn't work

0 Upvotes
trevorjones71
Key Advisor

Hi @fzubiran 

 

Is the tracking code installed on the page, and are you recording page views for that page in HubSpot?

 

 

-Trevor

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