Skip to main content
Sometimes your thank-you page needs context about what the user submitted. Because the data is already available in the browser, you can build query parameters and redirect after a successful Formbase submission. This is a client-side pattern that works well for simple personalization.
1

Submit the form

Post the form data to Formbase and treat a 303 response as success.
2

Build the redirect URL

const formData = new FormData(formElement);

const response = await fetch('https://formbase.dev/s/YOUR_FORM_ID', {
  method: 'POST',
  body: formData,
  redirect: 'manual',
});

if (response.status === 303 || response.ok) {
  const params = new URLSearchParams({
    name: String(formData.get('name') || ''),
    plan: String(formData.get('plan') || ''),
  });

  window.location.href = `/thanks?${params.toString()}`;
}
The redirect becomes something like /thanks?name=Chris&plan=pro.
If you need the server response, submit from a server action and return the data to the client.