In the two-step form embedded in the page, the callback is not triggered

Help!! My code looks like this: ```<!DOCTYPE html>
<html lang=“en”>
<head>
<meta charset=“UTF-8”>
<meta name=“viewport” content=“width=device-width, initial-scale=1.0”>
<title>Document</title>
</head>
<body>
<div id=“hbspt-two-step-form”></div>
<script
charset=“utf-8”
type=“text/javascript”
src=“js.hsforms.net/forms/embed/v2.js”
></script>
<script>
hbspt.forms.create({
region: ‘na1’,
portalId: ‘my-portal-id’,
formId: ‘my-two-step-form-id’,
target: `#hbspt-two-step-form`,
onFormReady: function($form) {
console.log(‘form ready’);
},
onFormSubmit: function($form) {
console.log(‘form submitting’);
},
onFormSubmitted: function($form){
console.log(‘form submitted’);
}
});
</script>
</body>
</html>```, but when I open the page, there is only one error in the console: 'v2.js:2
GET https://forms.hsforms.com/embed/v3/form/5698963/3e297980-4a06-4a31-82a7-19d6cf5cfe33/json?hs_static_app=forms-embed&hs_static_app_version=1.8715&X-HubSpot-Static-App-Info=forms-embed-1.8715 403 (Forbidden)
(anonymous) @ v2.js:2
e.exports @ v2.js:2
e.exports @ v2.js:2
c.request @ v2.js:2
r.forEach.c.<computed> @ v2.js:2
(anonymous) @ v2.js:2
nv @ v2.js:2
uv @ v2.js:2
GE @ v2.js:2
(anonymous) @ test.html:16
', the onFormReady callback function is not executed as expected, but if my form is not a two-step form, the whole process is normal and the callback will fire normally

Hi @Bearbug,

The 403 (Forbidden) error you’re seeing means that the HubSpot form embed can’t access your two-step form. This is why your callbacks, like onFormReady, aren’t firing. They only trigger if the form loads successfully.

Here are a few things to check:

  1. Ensure your two-step form is published and set to be shared externally. If it’s marked as private or restricted, it won’t load outside HubSpot.
  2. HubSpot’s embed API can sometimes have issues with two-step forms, as they’re more complex. Try embedding a standard form. If it works, the problem is likely with two-step form support.
  3. If your HubSpot account limits form embeds to certain domains, verify that your site’s domain is allowlisted.

If you’ve checked all the above and it still doesn’t work, consider reaching out to HubSpot Support, as two-step forms sometimes need special handling or might not be fully supported for embedding.

Let me know if you need assistance checking any of these settings!