Skip to content

Checkbox in ActionForm with server function argument that is a struct #2714

Closed Answered by gbj
NCura asked this question in Q&A
Discussion options

You must be logged in to vote

HTML checkboxes don't send a boolean, they send either nothing or their value attribute. You can use #[serde(default)] to cover the "send nothing" case, and either use true as the value or receive it as a string instead of a bool and parse it yourself.

Replies: 2 comments 1 reply

Comment options

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

gbj Jul 26, 2024
Maintainer

Answer selected by NCura
Comment options

You must be logged in to vote
0 replies
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