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

Deselecting multpile checkboxes don't run validation. #317

Open
webskydavid opened this issue May 19, 2017 · 0 comments
Open

Deselecting multpile checkboxes don't run validation. #317

webskydavid opened this issue May 19, 2017 · 0 comments

Comments

@webskydavid
Copy link

webskydavid commented May 19, 2017

Hi.
I have multiple checkboxes, if I press submit it show me validation errors. After pressing one of them the validation error disapperars.
The values if one checkbox is pressed looks like this:
["30"]
After deselecting all checkboxes looks like this:
[] <- thats wrong, the value need to be empty.
The validation works only if I add onSet function to binding:

'input.usr:checkbox': {
      observe   : 'usr',
      onSet: function (value) {
        if(value.length > 0){
          return value;
        }
        return '';
      },
      setOptions: {
        validate: true
      }
    }

Example: http://jsfiddle.net/c3kK2/474/

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

1 participant