-
Notifications
You must be signed in to change notification settings - Fork 380
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
Problems with .isValid() on required checkboxes #598
Comments
Can I consider this project dead when, after 2 weeks, nobody answers or even just labels this issue? |
my best guess is, you have misused ko.validatedObservable. |
I now realised that you have used validatedObservable like in 'Getting Started' .. But check inside the library, maybe docs mislead you on this. |
I extended the VM correctly in the jsfiddle above. Also I know it works on a text input - but not on a checkbox/radio. That's why I started this issue. |
@krnlde The |
@krnlde Adding |
Alright thanks, I'll do a PR. Should I also build the dist? |
Any news here? |
Please check your PR. It seems the tests are falling. |
Not anymore. |
Looks good. Thanks. |
Hello, I don't think that the value Example: I have two radio buttons: "Yes" and "No". Selecting yes, the underlying observable is set to With your change the form is invalid even if I have selected No, because the observable is set to Here is the JSFiddle: https://jsfiddle.net/989d6tbb/ Let me know your thoughts. Thank you |
Hey guys! I experienced some problems when making checkboxes required (for example terms and conditions).
See here for reference: http://jsfiddle.net/v6d5y3or/
Expected behaviour: Form
.isValid()
should reflect the checkbox value:checkbox.true = form.true
andcheckbox.false = form.false
Actual behaviour: Form
.isValid()
is always true:checkbox.true = form.true
andcheckbox.false = form.true
I'm not really sure why this happens and one would think that
required: true
works together with thechecked
binding.A temporary solution to me is to implement a custom validator to make it work as expected:
The text was updated successfully, but these errors were encountered: