I’m trying to use the following code:
<script charset="utf-8" type="text/javascript" src="//js-eu1.hsforms.net/forms/embed/v2.js"></script>
<script>
hbspt.forms.create({
region: "eu1",
portalId: "26913186",
formId: "a106c8d3-ab30-4bdc-83d0-55d8874bd351"
});
</script>
The problem I have is: I use a “form window” – the user first click on a “contact button” and then an adaptive modal appears – the code for now is the following that is printed with js to the modal ( you can also check it live on ( https:wdsa.gr ) :
const contactHtml = `<div id="" class="formcontainer"><div class="contactformicons"><a href="tel:+302113332578" class=""><img class="ct" src="/media/icons/wdsa_agency_icons_telephone.svg" alt="Γραφιστικά στοιχεία της WDSA - Ανάπτυξη ιστοσελίδων και λογισμικού"></a><a rel="nofollow" target=”_blank” href="https://meetings-eu1.hubspot.com/konstantinos-anastasiades" class="calbtn"><img src="/media/icons/wdsa_appointment-calendar.svg" alt="Γραφιστικά στοιχεία της WDSA - Ανάπτυξη ιστοσελίδων και λογισμικού"></a></div><hr><form action="" class="contactform"><div class="nameinputs"><input disabled placeholder="Όνομα" name="firstname" type="text" class="name inputdesignmain"><input disabled placeholder="Επίθετο" name="lastname" type="text" class="surname inputdesignmain"></div><input placeholder="Τηλέφωνο" disabled name="phone" type="tel" class="tel inputdesignmain"><input disabled placeholder="Email" name="email" type="text" class="email inputdesignmain"><input disabled placeholder="Επάγγελμα/Εταιρία" name="company" type="text" class="profession inputdesignmain"><textarea placeholder="Γράψτε το μήνυμα σας εδώ.." class="Message inputdesignmain" name="message" id="" disabled cols="30" rows="10"></textarea><input style="font-size:1.2rem; margin-top:.4em;" disabled type="submit" class="sendrequest" value="Αποστολή"></form></div></div>`
What I’ve tried yet to do is the following code, replace the custom form with Hubspot’s embed script – But when I do it that way, the form does not load:
const contactHtml = `<div id="" class="formcontainer"><div class="contactformicons"><a href="tel:+302113332578" class=""><img class="ct" src="/media/icons/wdsa_agency_icons_telephone.svg" alt="Γραφιστικά στοιχεία της WDSA - Ανάπτυξη ιστοσελίδων και λογισμικού"></a><a rel="nofollow" target=”_blank” href="https://meetings-eu1.hubspot.com/konstantinos-anastasiades" class="calbtn"><img src="/media/icons/wdsa_appointment-calendar.svg" alt="Γραφιστικά στοιχεία της WDSA - Ανάπτυξη ιστοσελίδων και λογισμικού"></a></div><hr><script charset="utf-8" type="text/javascript" src="//js-eu1.hsforms.net/forms/embed/v2.js"></script>
<script>
hbspt.forms.create({
region: "eu1",
portalId: "26913186",
formId: "a106c8d3-ab30-4bdc-83d0-55d8874bd351"
});
</script></div></div>`

