Skip to content

How do you validate a checkbox boolean in a valibot form schema? #247

Closed Answered by fabian-hiller
rikhall1515 asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for the info. We should probably update value to support boolean as well. For now, literal is the way to go. It keeps the bundle size to a minimum and does a straight check for true.

const Schema = literal(true, 'Please accept our terms.');

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rikhall1515
Comment options

Answer selected by fabian-hiller
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants