Redirect to URL with submitted values from your form
Learn how to redirect users to a custom URL with their submitted form values. Pass form data as URL parameters for personalized thank-you pages.
When someone submits your form, you might want to redirect them to a custom page on your website instead of showing FormBackend’s default thank-you page. Even better, you can pass the submitted form values along in the URL so you can show a personalized confirmation message.
This is useful for showing order confirmations, personalizing thank-you pages, or passing data to analytics and tracking tools.
How it works
Let’s say you have a form like this:
<form action="https://www.formbackend.com/f/your-token-here" method="POST"> <label for="name">Name</label> <input type="text" id="name" name="name" required> <label for="email">Email</label> <input type="email" id="email" name="email" required> <label for="product">Product</label> <select id="product" name="product"> <option value="starter">Starter</option> <option value="pro">Pro</option> <option value="enterprise">Enterprise</option> </select> <button type="submit">Submit</button> </form>
In your FormBackend form settings, you can set a custom redirect URL that includes merge tags. Merge tags are placeholders wrapped in curly braces that get replaced with the actual submitted values.
For example, setting your redirect URL to:
https://www.mywebsite.com/thank-you?name={name}&email={email}&product={product}
When a user named “Jane” with email “jane@example.com” selects the “Pro” product and submits, they will be redirected to:
https://www.mywebsite.com/thank-you?name=Jane&email=jane%40example.com&product=pro
FormBackend automatically URL-encodes the values so special characters like @ are handled correctly.
Setting up the redirect
- Log in to FormBackend and go to your form
- Navigate to the Settings tab
- Find the Redirect URL field
- Enter your URL with merge tags for any fields you want to pass along
- Save your settings
That’s it. The next time someone submits the form, they’ll be redirected to your custom URL with the form values included.
Reading the values on your page
On your thank-you page, you can read the URL parameters with JavaScript to personalize the content:
<h1>Thanks, <span id="user-name"></span>!</h1> <p>We received your interest in our <span id="selected-product"></span> plan.</p> <script> const params = new URLSearchParams(window.location.search); document.getElementById('user-name').textContent = params.get('name'); document.getElementById('selected-product').textContent = params.get('product'); </script>
This gives the user a personalized confirmation without any server-side code.
Common use cases
- Order confirmations: Show the product name, quantity, or order total on a custom confirmation page
- Personalized thank-you pages: Greet the user by name after they fill out a contact form
- Analytics tracking: Pass form values to your analytics platform by including them in the redirect URL
- Conditional content: Show different content depending on a dropdown selection or checkbox value
- Lead qualification: Redirect users to different pages based on their answers (e.g., redirect enterprise leads to a calendar booking page)
Combining with other features
Redirects work alongside all of FormBackend’s other features. You can still receive email notifications for every submission, send auto-reply emails to the person who submitted, and forward data to integrations like Slack or Google Sheets.
For more details on redirect configuration, see the redirect after submission documentation. You can also customize the default thank-you page if you prefer not to redirect.
Next steps
- Create your first form to try redirects
- Learn about merge tags for more advanced templating
- Set up spam filtering so only legitimate submissions trigger redirects
Keep reading
HTML Form Input Types: What Each One Sends to Your Server
All 22 HTML form input types, what each one actually sends to your server, and why fields go missing: unchecked boxes, disabled inputs, and enctype.
The HTML Form Action Attribute: A Complete Guide
What the HTML form action attribute does, what to put in it when you have no server, how formaction works, and a checklist for when your form action won't submit.
Backend as a Service Examples: Real-World BaaS Use Cases
Discover real-world backend as a service examples, from forms to databases. Learn how to choose the best BaaS for your project with practical comparisons.
Add a form backend to your site in minutes
Connect any HTML form to FormBackend and start collecting submissions — no backend code required.
Start free