The onFormReady function in hbspt.forms.create requires jQuery. It was not run
I get the following error when I try to manipulate DOM loaded from Hubspot form. The onFormReady function in hbspt.forms.create requires jQuery. It was not run.
This is the code I use to change input field value:
hbspt.forms.create({
portalId: 'XXXXXX',
formId: 'aa8b5b4a-62ac-461b-a387-XXXXXXXXXXX',
onFormReady($form, ctx){
$('#firstname-6ae5c91f-67cf-40e7-bc53').val('Brian').change();
}
});
Anyone has the same issue?
As @Derek_Gervais is saying, you might not have jQuery loaded on the page. But if you don't need or want jQuery on the page, the offending code is $('#firstname-6ae5c91f-67cf-40e7-bc53')... This is jQuery syntax.
The onFormReady function in hbspt.forms.create requires jQuery. It was not run
I tried nothing under the onFormReady callback function, no matter what it gives me the same error:
shell.js:9 The onFormReady function in hbspt.forms.create requires jQuery. It was not run.
If I remover the onFormReady callback, I don't get error!