{"id":1665,"date":"2025-10-15T13:23:20","date_gmt":"2025-10-15T13:23:20","guid":{"rendered":"http:\/\/gogetmuscle.com\/?p=1665"},"modified":"2025-10-15T17:41:29","modified_gmt":"2025-10-15T17:41:29","slug":"hs-form-eventon-ready-firing-twice","status":"publish","type":"post","link":"http:\/\/gogetmuscle.com\/index.php\/2025\/10\/15\/hs-form-eventon-ready-firing-twice\/","title":{"rendered":"‘hs-form-event:on-ready’ firing twice"},"content":{"rendered":"
Hi there, I’m embedding a HS form into Webflow using the developer code embed option:<\/P><\/p>\n
Which works perfectly, however when I add an eventlistener like this<\/P>
\n window.addEventListener(‘hs-form-event:on-ready’, (event) => {
\n const { formId } = event.detail;
\n const timestamp = new Date().toISOString();
\n console.log(
\n `\ud83d\udca1 Form ready event fired for Form ID: ${formId} at ${timestamp}`
\n );
\n });
\n
I can see that in my Console tab, that it fired twice.<\/P>
Hi there, I’m embedding a HS form into Webflow using the developer code embed option: Which works perfectly, however when I add an eventlistener like this window.addEventListener(‘hs-form-event:on-ready’, (event) => { const { formId } = event.detail; const timestamp = new Date().toISOString(); console.log( `\ud83d\udca1 Form ready event fired for Form ID: ${formId} at ${timestamp}` ); }); […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[14],"tags":[],"_links":{"self":[{"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/posts\/1665"}],"collection":[{"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/comments?post=1665"}],"version-history":[{"count":1,"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/posts\/1665\/revisions"}],"predecessor-version":[{"id":1666,"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/posts\/1665\/revisions\/1666"}],"wp:attachment":[{"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/media?parent=1665"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/categories?post=1665"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/tags?post=1665"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}<\/span><\/P>
What could be causing this?
I want to inject some data dynamically into a hidden field and I’m not sure if this is a realiable way of checking that my form is loaded and ready.<\/P><\/p>\n","protected":false},"excerpt":{"rendered":"