<?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 Embedded form function in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Embedded-form-function/m-p/278090#M12798</link>
    <description>&lt;P&gt;Is there a way to ensure that my method inside onFormSubmit has fully run before the forms redirect happens?&lt;/P&gt;</description>
    <pubDate>Mon, 01 Jul 2019 12:55:20 GMT</pubDate>
    <dc:creator>Siyabonga</dc:creator>
    <dc:date>2019-07-01T12:55:20Z</dc:date>
    <item>
      <title>Embedded form function</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Embedded-form-function/m-p/278090#M12798</link>
      <description>&lt;P&gt;Is there a way to ensure that my method inside onFormSubmit has fully run before the forms redirect happens?&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2019 12:55:20 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Embedded-form-function/m-p/278090#M12798</guid>
      <dc:creator>Siyabonga</dc:creator>
      <dc:date>2019-07-01T12:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded form function</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Embedded-form-function/m-p/279971#M12893</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/93739"&gt;@Siyabonga&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So far as I know, that's not possible. I believe the form redirect creates a new thread in the browser, which the callback functions don't have access to. There is some time before the redirect happens, so if you're running code that only takes a few milliseconds, the code should run I'd think. But if you're trying to do something that takes more time, like with timeouts or with promises, you could consider adding the redirect into your callback function. And then within the form editor, just select the inline thank you message option instead of the redirect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You've probably seen our docs, but we have those callbacks and events documented here:&amp;nbsp;&lt;A href="https://developers.hubspot.com/docs/methods/forms/advanced_form_options" target="_blank"&gt;https://developers.hubspot.com/docs/methods/forms/advanced_form_options&lt;/A&gt;&amp;nbsp;and here:&amp;nbsp;&lt;A href="https://developers.hubspot.com/global-form-events" target="_blank"&gt;https://developers.hubspot.com/global-form-events.&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're having trouble with a specific page, feel free to let me know and link it here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Leland&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 17:39:54 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Embedded-form-function/m-p/279971#M12893</guid>
      <dc:creator>lscanlan</dc:creator>
      <dc:date>2019-07-10T17:39:54Z</dc:date>
    </item>
  </channel>
</rss>

