HubSpot Form Block
Embed a HubSpot form into a WordPress post using the form’s ID.
Run the following snippet in your JavaScript dev console to show all hidden fields
// Inputs within a HubSpot iframe
var theIframe = document.querySelector(".hs-form-iframe");
if (theIframe) {
var iframeDoc = theIframe.contentWindow.document;
var iframeInputs = iframeDoc.querySelectorAll('input[type="hidden"]');
for (var i = 0; i < iframeInputs.length; i++) {
iframeInputs[i].type = "text";
}
var iframeDivs = iframeDoc.querySelectorAll("div.hs-form-field");
for (var i = 0; i < iframeDivs.length; i++) {
iframeDivs[i].style.display = "block";
}
}
// Inputs directly injected into the page by HubSpot
var theInputs = document.querySelectorAll('form input[type="hidden"]');
for (var i = 0; i < theInputs.length; i++) {
theInputs[i].type = "text";
}
var theDivs = document.querySelectorAll("form div.hs-form-field");
for (var i = 0; i < theDivs.length; i++) {
theDivs[i].style.display = "block";
}
Examples
Register for webinar
Label
Where is this block used?
This block is used on 8 different URLs
| Post Type | Post ID | |
|---|---|---|
| Request a CoderPad Play demo | Page | 39822 |
| CoderPad Map | Page | 36953 |
| Outsourced EMEA SDR Form | Page | 36704 |
| Partner Form | Page | 35993 |
| Outsourced SDR Form | Page | 35177 |
| Press Releases | Page | 34064 |
| LinkedIn Learning Form | Page | 32941 |
| Press | Page | 8612 |