Hidden field
In this example, we add a hidden field to our form.
const schema = z.object({
csrfToken: z.string().min(1),
firstName: z.string().min(1),
email: z.string().min(1).email(),
howYouFoundOutAboutUs: z.enum(['fromAFriend', 'google']),
})
export default () => (
<Form
schema={schema}
hiddenFields={['csrfToken']}
values={{ csrfToken: 'abc123' }}
/>
)
Hidden field
In this example, we add a hidden field to our form.
const schema = z.object({
csrfToken: z.string().min(1),
firstName: z.string().min(1),
email: z.string().min(1).email(),
howYouFoundOutAboutUs: z.enum(['fromAFriend', 'google']),
})
export default () => (
<Form
schema={schema}
hiddenFields={['csrfToken']}
values={{ csrfToken: 'abc123' }}
/>
)