How To Programatically Run Code When Growform Loads
Sometimes, you may wish to run some code on your website - but only once Growform has loaded.
To do this, you can add an event listener to the page Growform is embedded in:
window.addEventListener('growform_loaded', function (e) {
// Insert your custom code here
}, false);
// Insert your custom code here
}, false);
This can be used in conjunction with our
updateHiddenField method, allowing you to update hidden fields in Growform once the form is ready.
Please note, this is only for forms embedded using the "embed" (rather than the "overlay" or "link") methods.
Your code should be placed
above the Growform embed tag.