Yes, you can automatically capture the current page URL in a Webflow form without editing each form individually or breaking Symbol functionality. This requires adding a custom script that dynamically populates a hidden form field with the page’s URL.
page-url
and a custom ID like form-page-url
.Go to Project Settings > Custom Code > Footer.
Paste the following script inside the Before
tag section:
Script (inline reference only):
This JavaScript finds the hidden input by ID and sets its value to the current window URL:
`document.addEventListener("DOMContentLoaded", function() {
var urlField = document.getElementById("form-page-url");
if (urlField) {
urlField.value = window.location.href;
}
});`
This script runs on every page and auto-fills the hidden field with the URL if the field exists.
To capture the current URL in a Webflow form symbol, add a hidden input with a unique ID, then use a site-wide script to populate that field with the page's URL. This approach preserves Symbol functionality and works across all pages without manual edits.