title: jQuery validation for multiple input fileds
body: <p>I have 4 input fields as below screen.
  <a href="https://i.stack.imgur.com/JrLkx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JrLkx.png" alt="enter image description here"></a></p>
  
  <p>Code is below.</p>
  
  <pre><code>&lt;input class="form-control licence-group" name="LicenceNumber1" id="LicenceNumber1" type="text"&gt;
  
  &lt;input class="form-control licence-group" name="LicenceNumber1Date" id="LicenceNumber1Date" type="text"&gt;
  
  
  &lt;input class="form-control licence-group2" name="LicenceNumber2" id="LicenceNumber2" type="text"&gt;
  
  &lt;input class="form-control licence-group2" name="LicenceNumber2Date" id="LicenceNumber2Date" type="text"&gt;
  </code></pre>
  
  <p>I'm using this with <a href="https://github.com/rstaib/jquery-steps" rel="nofollow noreferrer">jQuery Step Plugin</a>.</p>
  
  <p>I want to validate this with following conditions.</p>
  
  <ol>
  <li>All fields are required</li>
  <li>If filled LicenceNumber1 and LicenceNumber1Date then no need LicenceNumber2 and LicenceNumber2Date fields.</li>
  <li>Same as if filled LicenceNumber2 and LicenceNumber2Date then no need LicenceNumber1 and LicenceNumber1Date fields.</li>
  <li>Every pair of input fields are required(EG: Licence number and Date)</li>
  <li>If filled 3 fields other remaining field is required.
  EG: licence 1, licence1 date, licence 2 filled then licence2 date is required.</li>
  </ol>
  
  <p>I used the below code. But it doesn't work.</p>
  
  <pre><code>rules: {
              LicenceNumber1: {
                  required: function (element) {
                      return (($("#LicenceNumber1Date").is(':empty')) &amp;&amp; ($("#LicenceNumber2").is(':empty') || $("#LicenceNumber2Date").is(':empty')) );
                  }
              },
                LicenceNumber1Date: {
                    required: function (element) {
                        return (($("#LicenceNumber1").is(':empty')) &amp;&amp; ($("#LicenceNumber2").is(':empty') || $("#LicenceNumber2Date").is(':empty')));
  
                  }
              },
              LicenceNumber2: {
                  required: function (element) {
                      return (($("#LicenceNumber2Date").is(':empty')) &amp;&amp; ($("#LicenceNumber1").is(':empty') || $("#LicenceNumber1Date").is(':empty')));
                  }
              },
              LicenceNumber2Date: {
                  required: function (element) {
                      return (($("#LicenceNumber2").is(':empty')) &amp;&amp; ($("#LicenceNumber1").is(':empty') || $("#LicenceNumber1Date").is(':empty')));  
                  }
              } 
          } 
  </code></pre>
  
  <p>Please assume I have changed the input IDs to understandable. If it's possible without jquery validation plugin and using normal jquery it's also fine.
  If someone can help me to correctly validate this really appreciate your help.
  Thank you</p>