import { PageSection } from "../PageSection.tsx"; import { SideBySide } from "../SideBySide.tsx"; import { CodeWindow } from "../CodeWindow.tsx"; import { CodeBlock } from "../CodeBlock.tsx"; import { SectionHeading } from "../homepage/SectionHeading.tsx"; import { DemoBox } from "../homepage/DemoBox.tsx"; import { ExampleArrow } from "../homepage/ExampleArrow.tsx"; import { FancyLink } from "../FancyLink.tsx"; import { FormSubmitDemo } from "../../islands/FormSubmitDemo.tsx"; const routingCode = `import { Handlers } from "$fresh/server.ts"; export const handler: Handlers = { async POST(req) { const form = await req.formData(); // Do something with the form data here, // then redirect user to thank you page const headers = new Headers(); headers.set("location", "/thanks"); return new Response(null, { status: 303, headers, }); }, };`; export function FormsSection() { return (
Forms, the right way

Don't fight the browser. Fresh helps you handle form submissions and other dynamic requests server-side, from any route.

Since Fresh is built on{" "} Deno, it's built on web standards.

Forms in Fresh
); }