Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.formbase.dev/llms.txt

Use this file to discover all available pages before exploring further.

Formbase does not enforce conditional redirects on its own, but you can implement them easily in your frontend or server. The idea is simple: submit to Formbase, then choose a destination based on the submitted values. This keeps your logic close to your UI and avoids complex backend rules.
1

Collect the form data

Read values from the form using FormData.
2

Submit and redirect

const formData = new FormData(formElement);
const plan = String(formData.get('plan') || 'free');

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

if (response.status === 303 || response.ok) {
  if (plan === 'pro') {
    window.location.href = '/thanks-pro';
  } else {
    window.location.href = '/thanks-free';
  }
}
Any field can drive the redirect logic.
For server-driven routing, submit from a backend endpoint and redirect from there.