Yes you can! Or switch to the window events that are available:
window.addEventListener('message', event => {
if (event.data.type === 'hsFormCallback' && event.data.eventName === 'onFormReady') {
// Your code here.
}
});
If you want to change the value of anything other than a radio or checkbox input, you can use the dispatchEvent. If you want to change the value of a checkbox or radio input, use click instead:
Yes you can! Or switch to the window events that are available:
window.addEventListener('message', event => {
if (event.data.type === 'hsFormCallback' && event.data.eventName === 'onFormReady') {
// Your code here.
}
});
If you want to change the value of anything other than a radio or checkbox input, you can use the dispatchEvent. If you want to change the value of a checkbox or radio input, use click instead: