I am trying to serialize an array for inputs in the Hubspot form to add or change cookies, but I keep getting the error
Код: Выделить всё
onFormReady function from hbspt.forms.create TypeError: e.serializeArray is not a functionКод: Выделить всё
hbspt.forms.create({
region: "",
portalId: "",
formId: "",
redirectUrl: "/thank-you/",
onFormReady: function(e){
e.serializeArray().map(x=>{
let cookie_val = Cookies.get(x.name)
if (cookie_val && cookie_val != ''){
e.find('input[name="'+x.name+'"]').val(cookie_val).change();
}
})
}
});
Источник: https://stackoverflow.com/questions/781 ... rror-e-ser
Мобильная версия