APIs & Integrations

WOnlineSchule
Member

Form is shown two times on page

Hello everybody;

I integrated the generated code <script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/embed/v2.js"></script>
<script>
hbspt.forms.create({
region: "na1",
portalId: "8716917",
formId: "6348a566-ce92-4334-ba6a-ca5c0a376b31"
});
</script>


on my page Informationsgespraech (deutsche-online-schule.com)

It is shown two times there.

I can't find a solution. Any ideas?

Thanks, Sascha

0 Upvotes
5 Replies 5
WOnlineSchule
Member

Form is shown two times on page

I tried diffrent versions but the best result I can get is turning the two scrips around. Any other solution is having the script two times or not at all. Then the form is only shown after the footer, which I took out. The only problem with that is, that the form ist 100% page filling, which doesn't look nice. But at least it is not two times there. 

0 Upvotes
Jaycee_Lewis
Community Manager
Community Manager

Form is shown two times on page

Hey, @WOnlineSchule 👋 When I use the Chrome Page inspector tool, I see your form embed code in two separate divs. The expected location uses a div without an id. In the unexpected location, at the bottom of your page, the form is in a div with an id of id="hbspt-form-a41f029c-acd8-4d51-a8ec-1847da503e6e”.

CleanShot 2023-03-20 at 16.54.56.png

 

I'd start there and look at your template to see if the second form div needs to be there or if it was added or duplicated accidentally. 

Hey, @Jnix284 @assi, do you have anything you can add? 

 

Thank you! — Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes
Jnix284
Most Valuable Member | Elite Partner
Most Valuable Member | Elite Partner

Form is shown two times on page

@Jaycee_Lewis happy to take a second look, @WOnlineSchule can you share how you integrated the form? Did you add directly to the page via an embed in a rich text editor or did you add via the site or page head/footer HTML?


If my reply answered your question please mark it as a solution to make it easier for others to find.



Jennifer Nixon - Delivery Lead at Aptitude 8

connect with Jen on Linkedin

WOnlineSchule
Member

Form is shown two times on page

Hello I added it in the CMS inside a html div. But I have no idea, why it is generated two times. 

0 Upvotes
Jnix284
Most Valuable Member | Elite Partner
Most Valuable Member | Elite Partner

Form is shown two times on page

@WOnlineSchule it's hard to say without seeing the page configuration, but my guess is that it shows at the bottom because the script is firing twice.

 

My suggestion would be to move this part to the footer HTML:

<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/embed/v2.js"></script>

 

and keep this part where you want the form:

<script>
hbspt.forms.create({
region: "na1",
portalId: "8716917",
formId: "6348a566-ce92-4334-ba6a-ca5c0a376b31"
});
</script>

 

I'm not familiar with Mobirise, so I don't know where you would need to add the footer HTML, or if there is another place to add it.


If my reply answered your question please mark it as a solution to make it easier for others to find.



Jennifer Nixon - Delivery Lead at Aptitude 8

connect with Jen on Linkedin

0 Upvotes