andrewhathaway / Winterfell

Generate complex, validated and extendable JSON-based forms in React.
http://winterfell.andrewhathaway.net
MIT License
785 stars 116 forks source link

Allow checkboxInput to accept values for checked and unchecked #112

Open Pharserror opened 6 years ago

Pharserror commented 6 years ago

Currently the checkboxInput type will set a value in the questionAnswers if the checkbox is checked. The goal of this issue would be to not set just one value but accept "checked" and "unchecked" values to set when the checkbox is checked or unchecked. For example, a checkbox for a boolean: the questionAnswers for an input named thing[foo] would be { thing: { foo: "true" } } for a checked checkbox and { thing: { foo: "false" } } for an unchecked checkbox.

More than happy to submit a PR. Give me the goahead 👍

Cheers,

Pharserror commented 6 years ago

Update: I need this for my own project now; so, I am working on this.