A global function by the name you use for myGlobalFunctionName will be called when the form is submitted.
It is passed a single argument which is an object with the following structure:
{
submission_id: "XXXXXXXXXX",
total: null, // If there was a price processed
data: [
{
title: "My Question Title",
key: "xjsdjc", // Pre-fill key
value: "Dean" // Answer for this question for this submission
},
...
]
}
2. Event listener
Embedded forms also emit a custom event by the name of PaperformSubmission on submission, which can be listened to on the div from the embed, or on any parent element.
Details of the submission are located in event.detail.
Embedded forms also emit a custom event by the name of PaperformPageChange when the page changes on the form, which can be listened to on the div from the embed, or on any parent element.
Details of the page change are located in event.detail.