title: jQuery validate some input must be different from each other
body: <p><strong>EDIT2:</strong></p>
  
  <p>I feel I'm near the solution. Following the vicgoyso's suggestion I created some object from my inputs (and not arrays), and then I compared them: <a href="https://jsfiddle.net/awb4tcyy/2/" rel="nofollow noreferrer" title="jsfiddle">see the jsfiddle</a></p>
  
  <p>Since this comparison is working: <a href="https://jsfiddle.net/0918wd5t/2/" rel="nofollow noreferrer" title="comparison on jsfiddle">comparison on jsfiddle</a> I would expect the code above to work as well, but it's not.</p>
  
  <hr>
  
  <p><strong>EDIT:</strong>
  The jQuery method I was working on is similar to this:</p>
  
  <pre><code>$().ready(function(){
      $.validator.addMethod("same_names", function(value, element) {
          if (!$('#surname').val() || $('#surname').val() != null 
                  &amp;&amp; !$('#surname1').val() || $('#surname1').val() != null){
              return $('#name').val() != $('#name1').val() 
              &amp;&amp; $('#surname').val() != $('#surname1').val() 
              &amp;&amp; $('#nickname').val() != $('#nickname1').val()
          }
  
          }, " Your input is equal to another");
  
      $("#myForm").validate({
          rules: {
              name: {
                  required: false,
                  same_names: true
              },
              name1: {
                  required: false,
                  same_names: true
              },
              surname: {
                  required: false,
                  same_names: true
              },
              surname1: {
                  required: false,
                  same_names: true
              },
              nickname: {
                  required: false,
                  same_names: true
              },
              nickname1: {
                  required: false,
                  same_names: true
              },
          },
          messages: {
           ...
          }
      })
  });
  </code></pre>
  
  <p>It continue say that name, surname and nickname are required, and they are not.
  Without jQuery my method is similar to this:</p>
  
  <pre><code>$('#myForm').submit(function (event) {
      var errors = false;
      if ($('#name').val() == $('#name1').val() &amp;&amp;
          $('#surname').val() == $('#surname1').val() &amp;&amp;
          $('#nickname').val() == $('#nickname1').val()
          ||
          $('#name').val() == $('#name2').val() &amp;&amp;
          $('#surname').val() == $('#surname2').val() &amp;&amp;
          $('#nickname').val() == $('#nickname2').val()
          ||
          $('#name').val() == $('#name3').val() &amp;&amp;
          $('#surname').val() == $('#surname3').val() &amp;&amp;
          $('#nickname').val() == $('#nickname3').val()
          ||
          $('#name').val() == $('#name4').val() &amp;&amp;
          $('#surname').val() == $('#surname4').val() &amp;&amp;
          $('#nickname').val() == $('#nickname4').val()
          ....
          ||
          $('#name').val() == $('#name10').val() &amp;&amp;
          $('#surname').val() == $('#surname10').val() &amp;&amp;
          $('#nickname').val() == $('#nickname10').val()
          ||
          $('#name1').val() == $('#name2').val() &amp;&amp;
          $('#surname1').val() == $('#surname2').val() &amp;&amp;
          $('#nickname1').val() == $('#nickname2').val()
          ||
          $('#name1').val() == $('#name3').val() &amp;&amp;
          $('#surname1').val() == $('#surname3').val() &amp;&amp;
          $('#nickname1').val() == $('#nickname3').val()
          .... and so on
          ) {
          $("#error").show(); 
          location.href = "#";
                  location.href = "#error";
              errors = true;
      } else { 
        errors = false; 
        $("#error").hide();
      }
      if (errors == true) {
        event.preventDefault();
      }
  });
  </code></pre>
  
  <p>My actual jsp is similar to this (there are 10 input groups, formed by name + surname + nickname):</p>
  
  <pre><code>&lt;form id="myForm" method="post"&gt;
  &lt;input id="name" name="name" /&gt;
  &lt;input id="surname" name="surname" /&gt;
  &lt;input id="nickname" name="nickname" /&gt;
      &lt;br/ &gt;
  &lt;input id="name1" name="name1" /&gt;
  &lt;input id="surname1" name="surname1" /&gt;
  &lt;input id="nickname1" name="nickname1" /&gt;
  &lt;br/&gt;
  &lt;input id="name2" name="name2" /&gt;
  &lt;input id="surname2" name="surname2" /&gt;
  &lt;input id="nickname2" name="nickname2" /&gt;
      &lt;br /&gt;
  &lt;input id="name3" name="name3" /&gt;
  &lt;input id="surname3" name="surname3" /&gt;
  &lt;input id="nickname3" name="nickname3" /&gt;
      &lt;br /&gt;
      &lt;br /&gt;
  &lt;input id="submit" type="submit" value="submit" /&gt;   
  &lt;/form&gt;
  </code></pre>
  
  <p>I want to be an error just if one of this group (name, surname, nickname) is equal to another, for example this is an error:</p>
  
  <ul>
  <li>John</li>
  <li>Smith</li>
  <li><strong>prince</strong> * </li>
  <li>John</li>
  <li>Smith</li>
  <li><strong>prince</strong> *</li>
  <li>John</li>
  <li>Smith</li>
  <li>snowman</li>
  </ul>
  
  <p>But this one is not:</p>
  
  <ul>
  <li>John</li>
  <li>Smith</li>
  <li><strong>prince</strong> <em>at least one field is different so the input is fine</em></li>
  <li>John</li>
  <li>Smith</li>
  <li><strong>snowman</strong> *at least one field is different so the input is fine</li>
  <li>John</li>
  <li>Smith</li>
  <li><strong>fireball</strong> at least one field is different so the input is fine</li>
  </ul>
  
  <hr>
  
  <p><strong>QUESTION</strong>
  What if I want to use this code: <br/><a href="https://stackoverflow.com/a/16965721/4477899">https://stackoverflow.com/a/16965721/4477899</a>
  <br/>
  <br/>To solve this problem here: <br/><a href="https://stackoverflow.com/q/41259530/4477899">Form validate some input must be different from each other</a></p>
  
  <p>I'm asking because I'm already using jQuery validate, and the previous approach is not working well if fields are more than two groups, or are empty (those fields are not required).</p>