title: Validation on Table rows
body: <p>I want to make validations on table rows , I am doing in the following way but its not working.
  I want to apply it on click of save button at lst.</p>
  
  <p>I have 5 columns and want to apply validation for each column Suppose if any field is empty I want to disable the button.
  Can anybody help?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;div class="mainDiv" ng-if="currentForm != ''"&gt;
      &lt;table class="mappingTable"&gt;
          &lt;tr&gt;
              &lt;th&gt;#&lt;/th&gt;
              &lt;th&gt;CommCare Question&lt;/th&gt;
              &lt;th&gt;Data Element&lt;/th&gt;
              &lt;th&gt;Category Option Combo&lt;/th&gt;
              &lt;th&gt;Frequency/Period&lt;/th&gt;
              &lt;th&gt;Facility Identifier&lt;/th&gt;
          &lt;/tr&gt;
          &lt;tr ng-repeat="mappingElement in formIdMetadataMappingToObjectMap[currentForm.unique_id].mappingElements"&gt;
              &lt;td class="serialNoCell"&gt;{{$index+1}}.&lt;/td&gt;
              &lt;td title="{{mappingElement.commcareQuestion}}" class="commcareQuestion"&gt;{{mappingElement.commcareQuestionDescription}}&lt;/td&gt;
              &lt;td class="dhisDe"&gt; &lt;input type="text"
                                         name="foo"
                                         class="form-control"
  
                                         ng-model="mappingElement.dataElement"
                                         ng-class="{ error: !mappingElement.dataElement }"
                                         placeholder="{{'please_select_data_element'}}"
                                         uib-typeahead="dataElement as dataElement.name for dataElement in dataElements | filter:$viewValue | limitTo:20"
                                         uib-typeahead-focus-first="false"
                                         uib-typeahead-editable=false
                                         ng-blur="updateCategoryCombo(this.mappingElement)"
                      /&gt;&lt;/td&gt;
              &lt;td class="dhisCC"&gt;&lt;input type="text"
                                        name="foo"
                                        class="form-control"
                                        ng-model="mappingElement.categoryCombo"
                                        ng-class="{ error: !mappingElement.categoryCombo }"
                                        placeholder="{{'please_select_categorycombo'}}"
                                        uib-typeahead="categoryComboOption as categoryComboOption.name for categoryComboOption in categoryComboInputHolder[currentForm.unique_id+mappingElement.commcareQuestion] | filter:$viewValue "
                                        uib-typeahead-focus-first="false"
                                        uib-typeahead-editable=false
                      /&gt;&lt;/td&gt;
              &lt;td class="dhisPeriod"&gt;&lt;input type="text"
                                            name="foo"
                                            class="form-control"
                                            ng-model="mappingElement.period"
                                            ng-class="{ error: !mappingElement.period }"
                                            placeholder="{{'please_select_period'}}"
                                            uib-typeahead="period as period.name for period in periods | filter:$viewValue | limitTo:20"
                                            uib-typeahead-focus-first="false"
                                            uib-typeahead-editable=false
                      /&gt;&lt;/td&gt;
              &lt;td class="dhisOuIdentifier"&gt;&lt;input type="checkbox" ng-model="commcareQuestionToOrgUnitIdentifierMap[currentForm.unique_id+mappingElement.commcareQuestion]" ng-click="doOrgUnitUIOperations(this);" ng-disabled="!commcareQuestionToOrgUnitIdentifierMap[currentForm.unique_id+mappingElement.commcareQuestion]&amp;&amp;formIdToIsOrgUnitIdentifierPresentMap[currentForm.unique_id]"&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  
      &lt;div&gt;
          
          &lt;button type="button"  ng-disabled="!mappingElement.categoryCombo || !mappingElement.dataElement || !mappingElement.period"   ng-click="saveMetadataMapping()"&gt;{{'Save'}}&lt;/button&gt;
      &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>