<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Unable to Access New HubSpot Form in iframe (Same-Origin Policy Issue) in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-Access-New-HubSpot-Form-in-iframe-Same-Origin-Policy/m-p/1156348#M82276</link>
    <description>&lt;P&gt;Hi &lt;SPAN style="color:var(--ck-color-mention-text);"&gt;&lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/945165"&gt;@svirchenko&lt;/a&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;, thanks for your patience as I was looking into this for you and thank you so much for your help &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/601366"&gt;@sylvain_tirreau&lt;/a&gt;&lt;/SPAN&gt;!&lt;BR /&gt;&lt;BR /&gt;As &lt;SPAN style="color:var(--ck-color-mention-text);"&gt;&lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/601366"&gt;@sylvain_tirreau&lt;/a&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; mentioned, I also thought that the &lt;A href="https://developers.hubspot.com/docs/guides/api/marketing/forms/global-form-events" target="_blank"&gt;Global Form Events API&lt;/A&gt; would help you for that!&lt;BR /&gt;&lt;BR /&gt;Otherwise, you could also use the &lt;A href="https://developers.hubspot.com/docs/guides/api/crm/embed" target="_blank"&gt;Developer Embed Code&lt;/A&gt; if you are on a professional (and higher) subscription?&lt;BR /&gt;&lt;BR /&gt;Let us know if this works?&lt;BR /&gt;&lt;BR /&gt;Thanks and have a great weekend!&lt;BR /&gt;Bérangère&lt;/P&gt;</description>
    <pubDate>Fri, 23 May 2025 15:41:35 GMT</pubDate>
    <dc:creator>BérangèreL</dc:creator>
    <dc:date>2025-05-23T15:41:35Z</dc:date>
    <item>
      <title>Unable to Access New HubSpot Form in iframe (Same-Origin Policy Issue)</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-Access-New-HubSpot-Form-in-iframe-Same-Origin-Policy/m-p/1155489#M82218</link>
      <description>&lt;P class=""&gt;Hi HubSpot Community,&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;We’re currently integrating the &lt;SPAN class=""&gt;new HubSpot embedded forms&lt;/SPAN&gt; and running into an issue that breaks our previous enrichment logic.&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What worked before:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With legacy forms, the form would render inside an iframe without a src attribute, allowing us to access the inner DOM using:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;window.addEventListener('message', event =&amp;gt; {
  if (event.data.type === 'hsFormCallback' &amp;amp;&amp;amp; event.data.eventName === 'onFormReady') {
    const form = document.querySelector("#hs-form-iframe-0").contentDocument.querySelector('.hs-form');
    const emailInput = form.querySelector("input[name='email']");
    emailInput.addEventListener('keyup', () =&amp;gt; {
      // custom logic
    });
  }
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Problem now:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With the new HubSpot Forms (V3 static embed), the iframe now has a src pointing to &lt;A href="https://js.hsforms.net/ui-forms-embed-components-app/frame.html" target="_blank"&gt;https://js.hsforms.net/ui-forms-embed-components-app/frame.html&lt;/A&gt;, triggering the Same-Origin Policy. This means we can no longer access the iframe’s contentDocument, so any DOM query or event binding fails.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We’ve tried next:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;window.addEventListener('hs-form-event:on-ready', event =&amp;gt; {
   const form = document.querySelector("#hs-form-iframe-0").contentDocument.querySelector('.hs-form');
   const emailInput = form.querySelector("input[name='email']");
   emailInput.addEventListener('keyup', () =&amp;gt; {
     // custom logic here
   });
})&lt;/LI-CODE&gt;&lt;P class=""&gt;But this breaks because accessing the iframe’s DOM is blocked.&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What we’re looking for:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Does HubSpotFormsV4 expose a method to retrieve the form DOM element from the event. HubSpotFormsV4.getFormFromEvent(event) exists but doesn’t return a full DOM element or something we can work with.&lt;/LI&gt;&lt;LI&gt;Is there any official workaround or supported way to hook into form field events in the new embed model (e.g. keyup on email field)?&lt;/LI&gt;&lt;LI&gt;Can HubSpot provide an option to inject raw HTML or custom script blocks directly into the form or its wrapper, so that tracking/enrichment code can live within the same DOM context (i.e., not blocked by iframe restrictions)?&lt;/LI&gt;&lt;/UL&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;We’d really appreciate guidance on how to safely extend or interact with forms under the new embedding behavior while remaining compliant with browser security policies.&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 21 May 2025 22:39:52 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-Access-New-HubSpot-Form-in-iframe-Same-Origin-Policy/m-p/1155489#M82218</guid>
      <dc:creator>svirchenko</dc:creator>
      <dc:date>2025-05-21T22:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Access New HubSpot Form in iframe (Same-Origin Policy Issue)</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-Access-New-HubSpot-Form-in-iframe-Same-Origin-Policy/m-p/1155739#M82241</link>
      <description>&lt;P&gt;Hi &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/945165"&gt;@svirchenko&lt;/a&gt;&lt;/SPAN&gt; and welcome, it's great to see you here! &lt;span class="lia-unicode-emoji" title=":hugging_face:"&gt;🤗&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks for reaching out to the HubSpot Community and thanks for sharing your valuable feedback, it means a lot to us!&lt;BR /&gt;&lt;BR /&gt;I'll be checking on this for you internally, I'll get back to you as soon as I have more information.&lt;BR /&gt;&lt;BR /&gt;For information, here is the &lt;A href="https://developers.hubspot.com/docs/guides/cms/content/forms" target="_blank"&gt;HubSpot Forms API.&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;In the mean while, I'd love to check on this with our Top Experts: Hi &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/17186"&gt;@Anton&lt;/a&gt;, &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/601366"&gt;@sylvain_tirreau&lt;/a&gt;&lt;/SPAN&gt; and &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/133"&gt;@stefen&lt;/a&gt; are you using the new form in iframe? If yes, do you have any insights to share with &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/945165"&gt;@svirchenko&lt;/a&gt;&lt;/SPAN&gt;, please?&lt;BR /&gt;&lt;BR /&gt;Have a nice day and thanks so much in advance for your valuable contributions! &lt;span class="lia-unicode-emoji" title=":red_heart:"&gt;❤️&lt;/span&gt;&lt;BR /&gt;Bérangère&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2025 13:59:15 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-Access-New-HubSpot-Form-in-iframe-Same-Origin-Policy/m-p/1155739#M82241</guid>
      <dc:creator>BérangèreL</dc:creator>
      <dc:date>2025-05-22T13:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Access New HubSpot Form in iframe (Same-Origin Policy Issue)</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-Access-New-HubSpot-Form-in-iframe-Same-Origin-Policy/m-p/1155860#M82246</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Does it work if you do this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;window.addEventListener('hs-form-event:onFormReady', event =&amp;gt; {
  const formInstance = event.detail.form;
  const formEl = formInstance.getFormElement();
  const emailInput = formEl.querySelector("input[name='email']");
  emailInput.addEventListener('keyup', () =&amp;gt; {
       // Your code
  });
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2025 17:32:52 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-Access-New-HubSpot-Form-in-iframe-Same-Origin-Policy/m-p/1155860#M82246</guid>
      <dc:creator>sylvain_tirreau</dc:creator>
      <dc:date>2025-05-22T17:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Access New HubSpot Form in iframe (Same-Origin Policy Issue)</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-Access-New-HubSpot-Form-in-iframe-Same-Origin-Policy/m-p/1155964#M82250</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/601366"&gt;@sylvain_tirreau&lt;/a&gt;&amp;nbsp;, no - according to the documentation, there’s no hs-form-event:onFormReady event. I also tried listening for it just in case, but it doesn’t trigger anything.&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2025 20:16:45 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-Access-New-HubSpot-Form-in-iframe-Same-Origin-Policy/m-p/1155964#M82250</guid>
      <dc:creator>svirchenko</dc:creator>
      <dc:date>2025-05-22T20:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Access New HubSpot Form in iframe (Same-Origin Policy Issue)</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-Access-New-HubSpot-Form-in-iframe-Same-Origin-Policy/m-p/1156232#M82264</link>
      <description>&lt;P&gt;Okay. In order to help you better, is it mandatory that the form be in an iframe? If yes, why?&lt;/P&gt;&lt;P&gt;How do you currently insert the form on your page?&lt;/P&gt;</description>
      <pubDate>Fri, 23 May 2025 12:12:13 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-Access-New-HubSpot-Form-in-iframe-Same-Origin-Policy/m-p/1156232#M82264</guid>
      <dc:creator>sylvain_tirreau</dc:creator>
      <dc:date>2025-05-23T12:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Access New HubSpot Form in iframe (Same-Origin Policy Issue)</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-Access-New-HubSpot-Form-in-iframe-Same-Origin-Policy/m-p/1156243#M82266</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/601366"&gt;@sylvain_tirreau&lt;/a&gt;&amp;nbsp;I’m currently embedding a form using the provided share code, which inserts the form inside an iframe. I’d really prefer an option without iframe but this is how your embed implemented.&lt;/P&gt;&lt;P&gt;Previously, with legacy forms, the iframe was still present but didn’t include a src attribute — this allowed me to access the form elements (like the email input) using querySelector. However, with the new forms, the iframe has a src pointing to a different origin, which prevents any DOM access due to the Same-Origin Policy.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-05-23 at 14.24.21.png" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/146862iB4C4C7641356BCE1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-05-23 at 14.24.21.png" alt="Screenshot 2025-05-23 at 14.24.21.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-05-23 at 14.25.03.png" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/146863i508A31172B7C0DED/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-05-23 at 14.25.03.png" alt="Screenshot 2025-05-23 at 14.25.03.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 May 2025 12:28:26 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-Access-New-HubSpot-Form-in-iframe-Same-Origin-Policy/m-p/1156243#M82266</guid>
      <dc:creator>svirchenko</dc:creator>
      <dc:date>2025-05-23T12:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Access New HubSpot Form in iframe (Same-Origin Policy Issue)</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-Access-New-HubSpot-Form-in-iframe-Same-Origin-Policy/m-p/1156257#M82267</link>
      <description>&lt;P&gt;Ok.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So try something like that:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;&amp;lt;div id="your-hubspot-form"&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;script src="https://script-url"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script&amp;gt;
  hbspt.forms.create({
    portalId: 'YOUR_PORTAL_ID',
    formId:   'YOUR_FORM_ID',
    target:   '#your-hubspot-form',
    onFormReady: function(formEl) {
      const emailInput = formEl.querySelector("input[name='email']");
      if (emailInput) {
        emailInput.addEventListener('keyup', function(evt) {
          // Your code
        });
      }
    },
  });
&amp;lt;/script&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 May 2025 12:49:42 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-Access-New-HubSpot-Form-in-iframe-Same-Origin-Policy/m-p/1156257#M82267</guid>
      <dc:creator>sylvain_tirreau</dc:creator>
      <dc:date>2025-05-23T12:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Access New HubSpot Form in iframe (Same-Origin Policy Issue)</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-Access-New-HubSpot-Form-in-iframe-Same-Origin-Policy/m-p/1156270#M82268</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/601366"&gt;@sylvain_tirreau&lt;/a&gt;&amp;nbsp;I just tried this script with legacy form and new form just by switching form ids, it&lt;SPAN&gt;&amp;nbsp;works with legacy form, but doesn't work with new form:&amp;nbsp;onFormReady event is not fired; and it still creates new form in iframe with src attribute, and legacy form without src attribute&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 May 2025 13:25:52 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-Access-New-HubSpot-Form-in-iframe-Same-Origin-Policy/m-p/1156270#M82268</guid>
      <dc:creator>svirchenko</dc:creator>
      <dc:date>2025-05-23T13:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Access New HubSpot Form in iframe (Same-Origin Policy Issue)</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-Access-New-HubSpot-Form-in-iframe-Same-Origin-Policy/m-p/1156317#M82272</link>
      <description>&lt;P&gt;I think you'll have some restrictions with the new forms, since they're new. &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can try one last thing, but I'm not sure:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;window.addEventListener('message', event =&amp;gt; {
  if (
    event.origin.includes('hsforms.net') &amp;amp;&amp;amp;
    event.data.type === 'hsFormCallback' &amp;amp;&amp;amp;
    event.data.eventName === 'onFieldChange' &amp;amp;&amp;amp;      // or "onInput"
    event.data.payload.fieldName === 'email'
  ) {
    const email = event.data.payload.fieldValue;
    console.log('Email:', email);
    // Your code
  }
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you can put your form in raw HTML, that will solve the iframe problem, but I'm not sure it works with anything other than legacy forms (in your legacy form, tab "style &amp;amp; preview").&lt;/P&gt;</description>
      <pubDate>Fri, 23 May 2025 14:58:27 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-Access-New-HubSpot-Form-in-iframe-Same-Origin-Policy/m-p/1156317#M82272</guid>
      <dc:creator>sylvain_tirreau</dc:creator>
      <dc:date>2025-05-23T14:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Access New HubSpot Form in iframe (Same-Origin Policy Issue)</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-Access-New-HubSpot-Form-in-iframe-Same-Origin-Policy/m-p/1156328#M82273</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/945165"&gt;@svirchenko&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;UL&gt;&lt;LI&gt;Can HubSpot provide an option to inject raw HTML or custom script blocks directly into the form or its wrapper, so that tracking/enrichment code can live within the same DOM context (i.e., not blocked by iframe restrictions)?&lt;/LI&gt;&lt;/UL&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I think you should submit this idea here: &lt;A href="https://community.hubspot.com/t5/HubSpot-Ideas/idb-p/HubSpot_Ideas" target="_blank"&gt;https://community.hubspot.com/t5/HubSpot-Ideas/idb-p/HubSpot_Ideas&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 May 2025 15:09:21 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-Access-New-HubSpot-Form-in-iframe-Same-Origin-Policy/m-p/1156328#M82273</guid>
      <dc:creator>sylvain_tirreau</dc:creator>
      <dc:date>2025-05-23T15:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Access New HubSpot Form in iframe (Same-Origin Policy Issue)</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-Access-New-HubSpot-Form-in-iframe-Same-Origin-Policy/m-p/1156345#M82275</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/601366"&gt;@sylvain_tirreau&lt;/a&gt;&amp;nbsp;thanks for the suggestion. Unfortunately, it doesn’t seem to work — the message event isn’t triggered with the new forms, as shown in this example: &lt;A href="https://codepen.io/Serhii-Virchenko-the-scripter/pen/jEEgMXw" target="_blank" rel="noopener"&gt;https://codepen.io/Serhii-Virchenko-the-scripter/pen/jEEgMXw&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any chance that support for inserting custom HTML inside the form might be introduced in the near future?&lt;BR /&gt;That would be a great solution — even if the form remains in an iframe, having the script in the same scope would allow much more flexibility and will keep&amp;nbsp;Same-Origin Policy.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-05-23 at 17.35.04.png" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/146892i5FF6BA9F20D2C7CB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-05-23 at 17.35.04.png" alt="Screenshot 2025-05-23 at 17.35.04.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 May 2025 15:40:08 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-Access-New-HubSpot-Form-in-iframe-Same-Origin-Policy/m-p/1156345#M82275</guid>
      <dc:creator>svirchenko</dc:creator>
      <dc:date>2025-05-23T15:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Access New HubSpot Form in iframe (Same-Origin Policy Issue)</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-Access-New-HubSpot-Form-in-iframe-Same-Origin-Policy/m-p/1156348#M82276</link>
      <description>&lt;P&gt;Hi &lt;SPAN style="color:var(--ck-color-mention-text);"&gt;&lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/945165"&gt;@svirchenko&lt;/a&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;, thanks for your patience as I was looking into this for you and thank you so much for your help &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/601366"&gt;@sylvain_tirreau&lt;/a&gt;&lt;/SPAN&gt;!&lt;BR /&gt;&lt;BR /&gt;As &lt;SPAN style="color:var(--ck-color-mention-text);"&gt;&lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/601366"&gt;@sylvain_tirreau&lt;/a&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; mentioned, I also thought that the &lt;A href="https://developers.hubspot.com/docs/guides/api/marketing/forms/global-form-events" target="_blank"&gt;Global Form Events API&lt;/A&gt; would help you for that!&lt;BR /&gt;&lt;BR /&gt;Otherwise, you could also use the &lt;A href="https://developers.hubspot.com/docs/guides/api/crm/embed" target="_blank"&gt;Developer Embed Code&lt;/A&gt; if you are on a professional (and higher) subscription?&lt;BR /&gt;&lt;BR /&gt;Let us know if this works?&lt;BR /&gt;&lt;BR /&gt;Thanks and have a great weekend!&lt;BR /&gt;Bérangère&lt;/P&gt;</description>
      <pubDate>Fri, 23 May 2025 15:41:35 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-Access-New-HubSpot-Form-in-iframe-Same-Origin-Policy/m-p/1156348#M82276</guid>
      <dc:creator>BérangèreL</dc:creator>
      <dc:date>2025-05-23T15:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Access New HubSpot Form in iframe (Same-Origin Policy Issue)</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-Access-New-HubSpot-Form-in-iframe-Same-Origin-Policy/m-p/1156380#M82277</link>
      <description>&lt;P&gt;I can't answer your question about the feasibility of this: I'm not a HubSpot member ;).&lt;/P&gt;&lt;P&gt;As I mentioned before, I advise you to submit the idea on the appropriate forum.&lt;/P&gt;&lt;P&gt;But frankly, if I were you, and since you seem to be pretty good at development, I'd use legacy forms instead...&lt;/P&gt;</description>
      <pubDate>Fri, 23 May 2025 16:17:24 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-Access-New-HubSpot-Form-in-iframe-Same-Origin-Policy/m-p/1156380#M82277</guid>
      <dc:creator>sylvain_tirreau</dc:creator>
      <dc:date>2025-05-23T16:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Access New HubSpot Form in iframe (Same-Origin Policy Issue)</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-Access-New-HubSpot-Form-in-iframe-Same-Origin-Policy/m-p/1156383#M82278</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/945165"&gt;@svirchenko&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not aware of any options for working directly with the DOM inside of an iframe for the new HubSpot forms. You can still work with the form field values through the abstracted API calls to retrieve and set the values of a field.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, in order to mimic something like the "keyup" event listener, you could use poll the value periodically to look for changes with the&amp;nbsp;getFieldValue() method.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;await HubSpotFormsV4.getFormFromEvent(event).getFieldValue('0-1/email');&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, I assume that the goal of those event listeners would be to then manipulate the DOM based on user's input, so ultimately it might still not fit your use case.&lt;/P&gt;</description>
      <pubDate>Fri, 23 May 2025 16:16:10 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-Access-New-HubSpot-Form-in-iframe-Same-Origin-Policy/m-p/1156383#M82278</guid>
      <dc:creator>evaldas</dc:creator>
      <dc:date>2025-05-23T16:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Access New HubSpot Form in iframe (Same-Origin Policy Issue)</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-Access-New-HubSpot-Form-in-iframe-Same-Origin-Policy/m-p/1156385#M82279</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/230185"&gt;@BérangèreL&lt;/a&gt;&amp;nbsp;, thank you so much for taking the time to look into this — I really appreciate your help, and thank you again &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/601366"&gt;@sylvain_tirreau&lt;/a&gt;&amp;nbsp; for your input as well!&lt;/P&gt;&lt;P&gt;Just to clarify: the Developer Embed Code you’re referring to seems to be part of the HubSpot CRM Embed feature, which is intended for displaying interactive HubSpot interfaces inside custom apps.&lt;BR /&gt;However, in my case, I’m simply embedding a HubSpot form on my website using the provided embed code — not embedding CRM UI components.&lt;/P&gt;&lt;P&gt;Unfortunately, the suggestion doesn’t quite solve the issue I’m facing with the new form iframe structure and restricted access due to the src attribute.&lt;/P&gt;&lt;P&gt;Thanks again, and I hope you both have a great weekend as well!&lt;/P&gt;</description>
      <pubDate>Fri, 23 May 2025 16:13:09 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-Access-New-HubSpot-Form-in-iframe-Same-Origin-Policy/m-p/1156385#M82279</guid>
      <dc:creator>svirchenko</dc:creator>
      <dc:date>2025-05-23T16:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Access New HubSpot Form in iframe (Same-Origin Policy Issue)</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-Access-New-HubSpot-Form-in-iframe-Same-Origin-Policy/m-p/1157032#M82288</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/53048"&gt;@evaldas&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;You’re right — the logic works as follows: once the email is validated, the script sends a request to retrieve data, which is then used to populate values into hidden fields. If any of those hidden fields don’t receive a value, they should be made visible.&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;With your suggestion, I’m able to get the first part of the script working — thank you for that!&lt;/P&gt;</description>
      <pubDate>Mon, 26 May 2025 11:00:47 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-Access-New-HubSpot-Form-in-iframe-Same-Origin-Policy/m-p/1157032#M82288</guid>
      <dc:creator>svirchenko</dc:creator>
      <dc:date>2025-05-26T11:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Access New HubSpot Form in iframe (Same-Origin Policy Issue)</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-Access-New-HubSpot-Form-in-iframe-Same-Origin-Policy/m-p/1158326#M82337</link>
      <description>&lt;P&gt;Hi &lt;SPAN&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/945165"&gt;@svirchenko&lt;/a&gt;&lt;/SPAN&gt;, I hope that you are well!&lt;BR /&gt;&lt;BR /&gt;From what I can see, it seems that this is working as expected.&lt;BR /&gt;&lt;BR /&gt;In the new editor, you can't interact with the framed form, you need to use the&amp;nbsp;&lt;STRONG&gt;developer form&lt;/STRONG&gt; (equivalent of raw html) but &lt;STRONG&gt;you do need to have a Pro+ subscription to get that embed code,&lt;/STRONG&gt; see screenshot below.&lt;BR /&gt;&lt;BR /&gt;Let me know if you cannot find the Developer Form &lt;SPAN&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/945165"&gt;@svirchenko&lt;/a&gt;&lt;/SPAN&gt;?&lt;BR /&gt;If that's the case, please send me via private message your Hub ID.&lt;BR /&gt;&lt;BR /&gt;&lt;IMG src="https://lithium-response-prod.s3.us-west-2.amazonaws.com/hubspot.response.lithium.com/RESPONSEIMAGE/652ead0e-7fd6-40d8-88ed-9f26aa59fc51.default/EmbedCode.png" border="0" /&gt;&lt;BR /&gt;Thanks so much to all of you for your help!&lt;BR /&gt;&lt;BR /&gt;Have a lovely day!&lt;BR /&gt;Bérangère&lt;/P&gt;</description>
      <pubDate>Thu, 29 May 2025 10:41:51 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-Access-New-HubSpot-Form-in-iframe-Same-Origin-Policy/m-p/1158326#M82337</guid>
      <dc:creator>BérangèreL</dc:creator>
      <dc:date>2025-05-29T10:41:51Z</dc:date>
    </item>
  </channel>
</rss>

