To redirect users to a custom link with query parameters after a successful form submission in Webflow, you can use a JavaScript solution. Below is a guide on how to achieve this.
<script>
document.addEventListener('DOMContentLoaded', function () {
const form = document.querySelector('form');
form.addEventListener('submit', function (e) {
e.preventDefault(); // Prevent default Webflow form submission
// Perform any validations or actions here
const formData = new FormData(form);
const params = new URLSearchParams();
// Loop through formData and append it to URLSearchParams
for (const pair of formData.entries()) {
params.append(pair[0], pair[1]);
}
// Redirect to custom link with query parameters
window.location.href = https://your-custom-url.com?${params.toString()};
});
});
</script>
```
https://your-custom-url.com with the desired destination URL.
To redirect users to a custom URL with query parameters on successful form submissions in Webflow, insert a JavaScript code snippet in the Before </body> tag section. This script listens for form submissions, extracts input data, constructs query parameters, and redirects the user accordingly. Ensure to replace the placeholder URL with your actual target link.