backbone-forms
backbone-forms copied to clipboard
required array values must contain 1 element
fix for #266
what's the actual use-case where this was an issue?
Checking when arrays of values are returned, All current checks assume string values and checks for blank or false strings. An empty array returned by Checkboxes for example should be treated the same as an empty string passed from a Text input.
Specifying required on a Checkboxes item currently will never return an error what ever value it is passed
For example Which days are best for you ? Checkboxes of Monday - Sunday, a value of [] should not be accepted, ['Tuesday'] should and ['Tuesday','Wednesday'] etc should. But a empty array should not (ie no days selected)
Cool. It would be really nice if there was a test of this higher-level checkbox use case showing that this patch is necessary.
Where would that test go in the Validators ? or the Checkboxes ?
Any chance of this getting pulled in? Without this patch the "required" validation on a single check box does not work.
Sorry deleted the branch