0

The following radio button doesnt fire the subscription for the button to be enabled on the Android browser. It works on all desktops/browsers/OS and even iPhone but not Android. Am I missing something? It works if the input element is switched to a checkbox. I am using knockout.js 3.2.

<input type="radio" data-bind="checked: accept, disable: files().length == 0" />
<button class="btn submit" data-bind="click: submit, disable: $root.submitting() || !accept() || files().length == 0">Submit</button>

function SubmitTask(classSubmission, options) {
        var self = this;

        self.accept = ko.observable(false);
}
Mike Flynn
  • 22,342
  • 54
  • 182
  • 341
  • Which KO version are you using? Have you tried to run the official KO testsuit on the device? http://knockoutjs.com/spec/runner.html – nemesv Oct 30 '14 at 13:08
  • I did run the test suite and all looked good or at least passed, but I dont know if it actually covers this scenario or not with a radio button. – Mike Flynn Oct 30 '14 at 13:23
  • 1
    Are you sure that this setup with the one radio button is working on other browsers? Have you tried to "uncheck" your radio button? You can try to specify the value attribute to "fix" this: ``. Because in KO the checked binding is working differently for radio buttons and you have to work extra to properly work with boolean values: http://stackoverflow.com/questions/10127001/binding-true-false-to-radio-buttons-in-knockout-js – nemesv Oct 30 '14 at 13:27
  • Yes guarantee its working in everything else, just not this Android browser. – Mike Flynn Oct 30 '14 at 14:40
  • That was it, I added value="false" and now its working. Put that as the answer and Ill mark it. – Mike Flynn Oct 30 '14 at 14:45

1 Answers1

0

Adding value="true" fixed the issue.

Mike Flynn
  • 22,342
  • 54
  • 182
  • 341