When you embed a HubSpot form on your external page, you may see it appearing in different locations. This may be due to the form being dynamically rendered on the page, or an issue with multiple form embed codes being added to the same <div> tag in the page HTML.
Form dynamically renders on a page
A form may be dynamically rendered on a page and load in different locations. To ensure the form loads on a specific part of the page, add a target attribute to the form embed code to specify the specific container you want the form to render in.
In the form embed code, add a comma (,) after the formId attribute value, then enter a new line and enter target: '[container name]' . For example, you can force the form to render in an container on the page with the CSS class of sidebar.
Multiple form embed codes added to the same <div> tag
When you embed the same HubSpot form multiple times on an external page, the forms may appear side by side or in the wrong location if the form embed codes are added to the same <div> tag in the page HTML.
To ensure the forms load and display correctly, add the formInstanceId attribute and specify a unique value for each form embed code. In the form embed code, add a comma (,) after the formIdattribute value, then enter a new line and enterformInstanceId: '[number]' .It's recommended to number each form in the order it appears on the page (e.g., '1' for the first form, '2' for the second form, etc.).
Form does not load in older browsers
To ensure the forms load and display correctly, a target attribute can be added to each form embed code to specify the specific container you want the form to render in.