Skip to content

Instantly share code, notes, and snippets.

@sadiqmmm
Last active March 19, 2024 22:53
Show Gist options
  • Save sadiqmmm/6b03bb5be9d6bb2422d72a5616639c16 to your computer and use it in GitHub Desktop.
Save sadiqmmm/6b03bb5be9d6bb2422d72a5616639c16 to your computer and use it in GitHub Desktop.
Get your form’s URL when it’s embedded in another page - With Paperform, you have the capability to automatically retrieve the URL of your form's page, enabling you to discern the origins of your submissions when they're integrated into other web pages. Gain fresh insights into where your customers are completing your forms!
<div data-paperform-id="jwps"></div>
// Note: Please don't change/format the below line no 3. Keep as it is.
<script>(function () { var script = document.createElement('script'); script.src = "https://paperform.co/__embed.min.js"; document.body.appendChild(script); })()</script>
<script>
(function () {
const currentPageUrl = window.location.href;
const form = document.querySelector("[data-paperform-id='jwps']");
// formsubmiturl is your custom Pre-fill key:
form.setAttribute('prefill', "formsubmiturl=" + currentPageUrl);
}
)()
</script>
@sadiqmmm
Copy link
Author

sadiqmmm commented Mar 19, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment