When I using form.create method, The form is loaded but my custom JS code is not working as expected. I can only see 403 forbidden error in my console.
The code assiciated with functions are not triggering .
hbspt.forms.create({
region: “na1”,
portalId: “123456”,
formId: “abcdef-1234…”,
target: “#form-container”,
// Events
onFormReady: function($form) {
alert(‘Form is ready’);
},
onFormSubmit: function($form) {
alert(‘Form is ready to submit’);
},
onFormSubmitted: function($form) {
alert(‘Form is submitted’);
}
});