Forum Discussion

mimranyaseen's avatar
mimranyaseen
Copper Contributor
Nov 24, 2022

How can i add custom script when a form is successfully submitted?

I am embedding a Microsoft Form on my website. I want to capture the event when the form submits successfully. Below is the embedded code and I want to run my custom JavaScript code on form submit.

 

<div>

    <iframe width="640px" height="480px" src="https://forms.office.com/Pages/ResponsePage.aspx? id=BiopSuv_ckSNqp3fkzLnW_NGlVhpUkdKjXPYvQce5XRUQzgwTExXOU0wMlFIT0hFWUpIS04zTlhRVi4u&embed=true" frameborder="0" marginwidth="0" marginheight="0" style="border: none; max-width:100%; max-height:100vh" allowfullscreen webkitallowfullscreen mozallowfullscreen msallowfullscreen> </iframe>

</div>

2 Replies

    • mimranyaseen's avatar
      mimranyaseen
      Copper Contributor

      RobElliottthanks for your reply. Actually, i want to call a method on my web page when the submit button submits successfully. I will use window.parent.postMessage to send message to webpage that hosting iframe.

Resources