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.
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.