Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make BooleanParser understand "on" as true #46

Open
apeiniger opened this issue Mar 10, 2017 · 4 comments
Open

Make BooleanParser understand "on" as true #46

apeiniger opened this issue Mar 10, 2017 · 4 comments

Comments

@apeiniger
Copy link

"on" is default value for checkboxes in html in many browsers, therefore it would be great if "on" would be treated as true as well in the BooleanParser.

@mpscholten
Copy link
Owner

Could be implemented like the YesNoBooleanParser

@yuvalherziger
Copy link
Collaborator

Good point, that is indeed a missing feature, we can implement a type parser for that

@yuvalherziger
Copy link
Collaborator

yuvalherziger commented Mar 10, 2017

@apeiniger @mpscholten I'm not sure because it's been a while, but on for a default checkbox button always returns "on" if the checkbox exists, see example here. The point is, adding an OnOffBooleanParser is technically possible, but is it of any added value?

PR #47 already supports it, but the question at hand is whether in terms of HTML (of which the request parser is agnostic) a form would ever submit an off value by default for any browser

@apeiniger
Copy link
Author

Yeah, that was my idea as well, that's why I thought it could maybe be added to the normal BooleanParser instead, but up for discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants