To dynamically add user input to the end of a redirect URL in Webflow, you'll need to use custom JavaScript, since Webflow does not support dynamic redirect URLs natively.
userInput
).Example structure (do not include <script>
tags directly in Webflow answer):
document.querySelector("form").addEventListener("submit", ...
document.getElementById("userInput").value
window.location.href = "https://example.com/path/" + inputValue
If you want to redirect like https://yourdomain.com/result?code=USERINPUT
, your redirect code will append ?code=
followed by the input's value.
Make sure to URL-encode user input with encodeURIComponent()
, especially if it could include special characters.
tag section.
To append user input to a redirect URL in Webflow, use a standard form with a uniquely identified input field, then intercept the submission using custom JavaScript that reads the input and redirects the browser via window.location.href
.