# Nextjs Forms Setup - No luck

**URL:** <https://community.hubspot.com/t/nextjs-forms-setup-no-luck/65031>\
**Category:** HubSpot Ideas\
**Tags:** integrations\
**Created:** [September 13, 2022, 10:08pm UTC](https://community.hubspot.com/t/nextjs-forms-setup-no-luck/65031 "2022-09-13T22:08:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kennethbrenes](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/kennethbrenes/32/31184_2.png) [@kennethbrenes](https://community.hubspot.com/u/kennethbrenes)\
**Post date:** [September 13, 2022, 10:08pm UTC](https://community.hubspot.com/t/nextjs-forms-setup-no-luck/65031/1 "2022-09-13T22:08:53Z")

</div>

Hi there, I have been trying to add a footer subscription form from Hubspot in my Nextjs App.  
After trying some ways, and checking the documentation around this( not much to be honest) seems that the best way is this:

```lia-code-sample
<Script id="hs-legacy-forms-js" src="//js.hsforms.net/forms/v2-legacy.js" strategy="beforeInteractive" />
 <Script id="hs-forms-js" src="//js.hsforms.net/forms/v2.js" strategy="beforeInteractive" onLoad={() =>hbspt.forms.create({})}/> 
 <Script id="hbspt-footer" strategy="afterInteractive" dangerouslySetInnerHTML={{ __html: `
 hbspt.forms.create({
 region: "na1",
 portalId: "20#####",
 formId: "5190425c-61e6-4ff3-bc6e-1d12786f903d",
 target: '#footer_form'
 });
 `}} />
 <div id="footer_form" className={styles.footer_form}></div>

```

Seem that it work, but at the second time that I refresh the page, I mean, the form not appears the first time that page loads.  
Is there any approach that I might be missing? This is a pain. Thanks!

---

<div class="post-metadata">

**Author:** ![PKafer](https://avatars.discourse-cdn.com/v4/letter/p/bc79bd/32.png) [@PKafer](https://community.hubspot.com/u/PKafer)\
**Post date:** [April 14, 2023, 3:12pm UTC](https://community.hubspot.com/t/nextjs-forms-setup-no-luck/65031/2 "2023-04-14T15:12:09Z")

</div>

Dear Kennethbrenes,

did you manage to fix the issue yourselve and already implemented it properly? I would be very interested in your solution.

Thanks in advance and all the best

Philipp
