Step 1:

You can configure it by going to the list view and clicking on the settings of the form.

Step 2:

On form settings under “General Settings", in the field Url event from parent you will add the complete url where the form will show and save the changes. .

Step 3:

In order to receive the event on the parent site, it is important to add an event to the window where the form is displayed.

window.addEventListener("message", function(message){console.log(message.data)});


Note: Defending against HTML5 postMessage vulnerabilities:

-The receiving page should ensure that the origin is the expected location

-The receiving page should ensure that received data is validated to ensure that it’s safe

Example of code validating origin and message information:

// Add event to window

var eventMethod = window.addEventListener

      ? "addEventListener"

      : "attachEvent";

  var eventer = window[eventMethod];

  var messageEvent = eventMethod === "attachEvent"

    ? "onmessage"

    : "message";

//Function that receives the message

  eventer(messageEvent, function (e) {

//Url Webstore

   var url_message="https://regtech.identitymind.store/"  

//Validate url and message

    if (e.origin!=url_message || e.data!="SubmitForm")

     return;

   console.log("event")

     

  });


Note: We work with this method because the message sent from the iframe to the father does not have relevant data is not requested accepts multiple domains.

Did this answer your question?