We are building a Single Page Application using Knockout, Durandal & Breeze.
We have a observable array, & want to validate whether it contains any value or not i.e. the text box accepting values has been provided with any value or not. I am trying to achieve this using Knockout.Validation plugin.
Code for view model is-
withs = ko.observableArray([]).extend({ required: true }),
and HTML is
<div class="col-lg-9">
<select multiple="true"
data-bind="options: entities, optionsValue: 'Id', optionsText: 'Name',
selectedOptions: withs, select2: {}"
style="width: 249px; border-radius: 4px;"></select>
</div>
You could write a custom validator like:
Would double check the docs to see if this is included first though