Since Pardot forms are rendered in an iframe, it is not possible to listen for events that occur in an iframe. Work around is to add some custom code in the form that lets the website know that the when lead form was successfully submitted.
In your Salesforce Pardot form builder, navigate to Look and Feel > Above Code, enable the source mode. Add the below code.
<script type="text/javascript"> pardot.$(document).ready(function($) { $("#pardot-form").bind('submit', function(e) { try { parent.postMessage('formSubmission', '*'); } catch (e) { window.console && window.console.log(e); } }); }); </script>
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article