PIC Knowledge Base

How to keep my HubSpot form from loading at the bottom of the screen?

Written by Admin | Aug 12, 2022 4:00:00 AM

When using HubSpot forms, there are instances where the form will load at the bottom of the page and NOT in the DIV tag you intend it to.

To fix this, add a TARGET parameter to the embed code as noted below:

<div id="formhome">

<!--[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: "4000347",

formId: "829db39f-ecff-4155-96a9-41f9b6d899c3",

css: "",

target: "#formhome"

});

</script>

</div>