FormData
The standard browser object holding the fields of a submitted form as name and value pairs.
In more detail
It is what a browser builds when a form is submitted, and scripts can create one to send fields with fetch. Values are strings or files, so the receiver must validate and convert them.
Example
A Next.js Server Action used as a form action receives a FormData; read fields with formData.get('email').Related terms
- form action — The action prop of a form, or formAction on a button, which in React can be a Server Action that receives the submitted FormData.
- Zod — A TypeScript library for declaring validation schemas that check data at run time and also produce matching static types.
Taught in
- Server Actions: use server Directives & Mutations — Next.js 15 & Modern App Router Architecture
- Server Action Security: Zod Validation & Auth Gates — Next.js 15 & Modern App Router Architecture