GOGETMUSCLE Community ‘hs-form-event:on-ready’ firing twice

‘hs-form-event:on-ready’ firing twice

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(
`💡 Form ready event fired for Form ID: ${formId} at ${timestamp}`
);
});

I can see that in my Console tab, that it fired twice.

NRak_2-1760534449295.png


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.

Leave a Reply

Your email address will not be published.

Related Post