Share and collect submissions

You've built a form and saved it to the database. The results page shows a link to the public form URL — that's the page where people fill it out. Let's use it.

Fill out your own form

Click the public form URL on the results page — it should look like http://localhost:5173/forms/1. You should see your form title and the fields you created, ready to fill out.

Open it in a different browser (or an incognito window) to really feel the two-user experience. You're not the creator now — you're the respondent. Fill it out with some test answers and hit submit.

submissions new

If everything worked, the submission is sitting in your database. Check — open data/dev.db in VS Code and look at the submissions table.

submissions

One page, many forms

Notice something about the URL. /forms/1 shows your form. If you created another form, it would live at /forms/2 — same page, different data. There isn't a separate file for each form. There's one page template that works for any form ID.

This is called a dynamic route. The $id in the filename is a placeholder — the app reads the real ID from the URL, loads that form's data, and renders the right fields.

?What is a dynamic route?

The full round-trip

Follow the data through what just happened:

  1. You created a form on /forms/new — it was saved to the forms table
  2. You visited /forms/1 — the server loaded the form from the database and built the page
  3. You filled it out and hit submit — your answers were saved to the submissions table
  4. You visit the results URL — the server reads those submissions and shows them to you

Each of those steps maps to a specific part of the route file — a loader that reads data, a component that renders it, and an action that handles submissions. It's all in one file.

?The loader → Page → action cycle

Two different people, two different pages, connected through the database. This is what makes it an app, not a website.

Check your submissions

submissions view

Go back to the results page — the one with the long token in the URL. You should see the submission from the last step — the name, email, and comments you typed in.

Try submitting the public form a few more times with different answers. Refresh the results page. Each submission should appear.

Right token — you see submissions. Wrong token — access denied. That's the capability URL pattern doing its job.