title: Check if is there any duplicate values in a table
body: <p>I have a <code>Table</code> with multiple <code>rows</code> and in each row there are some input fields and i want check if there is  <code>Duplicates value</code> in table.</p>
  
  <p>Here is my code , first I'm trying to find if is there any empty value , how can I check if is there any duplicates value too?</p>
  
  <p>JavaScript:</p>
  
  <pre><code>&lt;script&gt;
   var isValid;
      function Step2Validation(e) {
          $(".trtickets").each(function () {
  
              var FindName = $(this).find(".navn");
              var FindLastName = $(this).find(".efternavn");
  
              if (FindName.val() == "") {
                  isValid = false;
                  alert("Empty Name");
                  return false;
              }
              if (FindLastName.val() == "") {
                  isValid = false;
                  alert("Empty Lastname");
                  return false;
              }
  
              else {
                  $(e).closest('fieldset').slideUp().next().slideDown();
  
              }
  
          });
      }
  
      function step2(e) {
  
          Step2Validation(e);
  
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  
   &lt;tr class="trtickets"&gt;
    &lt;td&gt;
      &lt;input type="text" name="model.RegistrationLists[0].Name" value="John" class="form-control navn" placeholder="Name"&gt;
    &lt;/td&gt;
    &lt;td&gt;
      &lt;input type="text" name="model.RegistrationLists[0].Lastname" class="form-control efternavn" placeholder="Lastname"&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr class="trtickets"&gt;
    &lt;td&gt;
      &lt;input type="text" name="model.RegistrationLists[1].Name" value="John" class="form-control navn" placeholder="Name"&gt;
    &lt;/td&gt;
    &lt;td&gt;
      &lt;input type="text" name="model.RegistrationLists[1].Lastname" class="form-control efternavn" placeholder="Lastname"&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
  
     &lt;button type="button" onclick="step2(this);" class="step2"&gt;Next&lt;/button&gt;
  </code></pre>