You want to automatically capture the current page URL in a form submission in Webflow — including when using the form as a reusable Symbol.
Note: Since forms use the same name for the hidden field (page-url), this will work across all instances without editing each form individually.
```javascript
<script>
document.addEventListener("DOMContentLoaded", function() {
const urlInputs = document.querySelectorAll('input[name="page-url"]');
urlInputs.forEach(input => {
input.value = window.location.href;
});
});
</script>
```
page-url.
page-url, and the script works globally, you can reuse the form across pages without updating or customizing it per instance.
page-url field.
Use a hidden field inside your Webflow form Symbol, and add a global script to auto-populate it with window.location.href. This method works universally across all pages using the Symbol and does not require editing the form per page.