Update for Hubspot breaks programmatic form
-
After the update to the latest version, i get a JS error:
hbspt.forms.create is not a function
The issue under the class-pagehooks.php file under add_form_management_script(). The hbspt.enqueueForm closes before the Object.defineProperty is called.
In the runtime, the create function is undefined.
Here is our custom code:
const $ = window.jQuery, portalId = window.App ? window.App.hubspot_portal_id : false; export default function () { if (!portalId) { return; } $('.hubspot-form').each(function (index) { const $this = $(this), id = 'hubspot-form-' + index; $(this).attr('id', id); hbspt.forms.create({ css: '', target: '#' + id, formId: $this.data('formId'), portalId: portalId, cssClass: 'hubspot-form', }); }); }
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
The topic ‘Update for Hubspot breaks programmatic form’ is closed to new replies.