All Collections
Meetings and forms
Embedded form submit and redirect
Embedded form submit and redirect
Redirect to a new page after a user submits an embedded form
Geoff Mina avatar
Written by Geoff Mina
Updated over a week ago

Due to browser security restrictions, iFrames are unable to redirect a parent page directly. The Hectic embedded forms use a mechanism called "Post Message" that allows the iFrame to communicate directly with the parent page that it is embedded within.

You can use this feature to support a post submission redirect by including the following code anywhere on the page that has the iFrame hosting the Hectic form:

<script type="text/javascript">
window.addEventListener("message", (event) => {
if(event.data === 'FORM_SUBMITTED'){
console.log('form has been submitted');
window.location = 'https://wwww.google.com'
}
}, false);
</script>


Simply replace "www.google.com" in the example above with whatever URL you would like the user redirected to.

Did this answer your question?