I have a requirement in which there is a form and if all the fields are filled then only submit button will be enabled else the submit button will be in disabled state.
This fiddle works fine for 1 input field:
<button data-bind="enable: my">My Button</button>
<input type="text" name="hi" data-bind="value:my" />
ko.applyBindings({ my: ko.observable() });
However, I don't know how to do this for multiple input fields like as in this fiddle. If there are some 10 input fields then how to enable the submit button if and only if all the fields are filled up.
You could use JQuery to solve this, by doing the following:
HTML Markup:
JQuery Script:
That should make your life a whole lot easier. Let me know if not.
HTML
JS:
See updated JSFiddle. The key to solving viewmodel inter-property dependencies is Knockout's computed observables.