How to handle checkbox? #254
Answered
by
fabian-hiller
jdgamble555
asked this question in
Q&A
-
I have a checkbox How can I handle this with valibot? I need to validate a boolean value. const TaskSchema = object({
name: string(),
completed: boolean()
});
const result = safeParse(TaskSchema, Object.fromEntries(formData));
... J |
Beta Was this translation helpful? Give feedback.
Answered by
fabian-hiller
Nov 19, 2023
Replies: 1 comment 7 replies
-
I recommend to use |
Beta Was this translation helpful? Give feedback.
7 replies
Answer selected by
fabian-hiller
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I recommend to use
decode-formdata
for that: https://github.com/fabian-hiller/decode-formdata