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").contentWindow.document;
var theInputs = theIframe.querySelectorAll('input[type="hidden"]');
for (var i = 0; i < theInputs.length; i++) {
theInputs[i].type = "text";
}
var theDivs = theIframe.querySelectorAll("div.hs-form-field");
for (var i = 0; i < theDivs.length; i++) {
theDivs[i].style.display = "block";
}
// Inputs directly injected into the page by HubSpot
var theInputs = document.querySelectorAll('.hbspt-form input[type="hidden"]');
for (var i = 0; i < theInputs.length; i++) {
theInputs[i].type = "text";
}
var theDivs = document.querySelectorAll(".hbspt-form div.hs-form-field");
for (var i = 0; i < theDivs.length; i++) {
theDivs[i].style.display = "block";
}
Examples
Where is this block used?
This block is used on 7 different URLs
Post Type | Post ID | |
---|---|---|
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 |