title: Atleast one field is mandatory in form: Form Validation in Angular
body: <p>I have got three input fields on a form.
  I am looking for a way in which a form is valid if either or any combination of inputs is required, It means atleast one is necessary .Also user may enter inputs in  any combination even then also form is valid.</p>
  
  <p>I have read ng-required but that will make my expression too long.</p>
  
  <pre><code>&lt;td&gt;Name&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" class="form-control input-xs" name="name"
       ng-model="ctrl.orderSearch.name" minlength="4"&gt;
  &lt;/td&gt;
  &lt;td&gt;Class&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" class="form-control input-xs" name="class"
       ng-model="ctrl.orderSearch.Class" minlength="6"&gt;
  &lt;/td&gt;
  &lt;td&gt;Roll No:&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" class="form-control input-xs" name="rollNo"
       ng-model="ctrl.orderSearch.RollNo" minlength="6"&gt;
  &lt;/td&gt;
  </code></pre>
  
  <p>Update: I don't want to diable submit button. The form is valid in either of these scenarios:</p>
  
  <p>1)field one or two or three is filled</p>
  
  <p>2) 1,2 or 1,3 or 2,3 is filled</p>
  
  <p>3) 1,2,3 is filled.</p>
  
  <p>Also, I tried to use: 
  ng-required="!(ctrl.orderSearch.name.length || ctrl.orderSearch.rollNo.length )" on fields. But when I submit my form ,an in built pop up from angular is presented on my name field saying "Please fill this required field" because whenever form.$valid is called on an empty form , field one would be checked first and hence pop up will be displayed on that field. But to user, it may seem field one is mandatory which is not the case. </p>
  
  <p>Also , I don't want to write a custom method for validation. Is is it possible using ng-required? Please help.</p>