Is it possible to pass a javascript variable into the embed form code as the formId?
My client is wanting to have different forms based on the content of the page but due to the structure of the application framework they are using the only place we can place the embed code is used for all pages using that template. The form works fine when the formId is manually assigned but this would require one generic form for all pages. When trying to pass in a variable the form does not load despite the variable being the same string that works when manually assigned.
var FormID = "###";
hbspt.forms.create({
portalId: "###",
formId: FormID
});