title: Knockout.validation on a Collection
body: <p>I am trying to set up validation on collection. I only want to proceed only if all of the items are filled out. In this case if Value is not selected then it will be 0, otherwise it will be in the range of 1 - 5.</p>
  
  <p>I have created the example: <a href="http://jsfiddle.net/jmogera/qBJwK/2/" rel="nofollow">http://jsfiddle.net/jmogera/qBJwK/2/</a></p>
  
  <p>In the console.log, the validation always returns true.</p>
  
  <p>ALSO not sure how to do this, but when "Next" button is pressed. I only want to show errors on the ones that are not selected.</p>
  
  <h2>HTML</h2>
  
  <pre><code>&lt;div data-bind="foreach: Items"&gt;
      &lt;span data-bind="text: Name"&gt;&lt;/span&gt;
      &lt;ul data-bind="validationElement: Value"&gt;
          &lt;li value="5" data-bind="css: { 'ui-selected': Value() === 5 }"&gt;
              Excellent
          &lt;/li&gt;
          &lt;li value="4" data-bind="css: { 'ui-selected': Value() === 4 }"&gt;
              Good
          &lt;/li&gt;
          &lt;li value="3" data-bind="css: { 'ui-selected': Value() === 3 }"&gt;
              Okay
          &lt;/li&gt;
          &lt;li value="2" data-bind="css: { 'ui-selected': Value() === 2 }"&gt;
              Poor
          &lt;/li&gt;
          &lt;li value="1" data-bind="css: { 'ui-selected': Value() === 1 }"&gt;
              Horrible
          &lt;/li&gt;
      &lt;/ul&gt;
  &lt;/div&gt;
  
  &lt;input type="button" data-bind="click: goNext" value="Next" /&gt;
  </code></pre>
  
  <h2>Javascript:</h2>
  
  <pre><code>var models = {
      Items: [{
          Name: "Survey 1",
          Value: 5},
             {
          Name: "Survey 2",
          Value: 0}]
  };
  
  var ItemViewModel = function(data){
              this.Name = data.Name,
              this.Value = ko.observable(data.Value).extend({notEqual : 0, number: true}),
              this.itemValidationGroup = ko.validatedObservable({
                  Value: this.Value,
              })
          };
  
  var mapping = {
      'Items':{
          create: function (options) {
              return new ItemViewModel(options.data);
          }
      }
  }
  
  var indexViewModel = ko.mapping.fromJS(models, mapping);
  indexViewModel.goNext = function(){
      for(i = 0; i &lt; indexViewModel.Items().length; i++){
       console.log(indexViewModel.Items()[i].itemValidationGroup.isValid());   
      }
  };
  ko.applyBindings(indexViewModel);
  </code></pre>