title: Duplicate input in form
body: <p>I have a dynamically generated form with multiple text input fields:</p>
  
  <pre><code>&lt;input class="w200" type="text" value="" name="field[7018]"&gt;
  &lt;input class="w200" type="text" value="" name="field[7019]"&gt;
  &lt;input class="w200" type="text" value="" name="field[7020]"&gt;
  ...
  &lt;input class="w200" type="text" value="" name="field[7055]"&gt;
  </code></pre>
  
  <p>Using jQuery, how can I detect duplicate values on input?</p>
  
  <p>There's a <a href="https://stackoverflow.com/questions/2955536/prevent-duplicate-values-using-jquery-validation">post on SO</a> that proposes the following solution:</p>
  
  <pre><code>$("#check").click(function() {
      $.post("checkname.php", 
             { name : $("#textboxname").val() },
             function(data) {
               //data will contain the output from the file `checkname.php`
               if(data=="ok") { //imagine the case it output ok if not duplicate is found
                  alert('ok');
               else { 
                  alert('duplicate name exists');
               }
      );
  });
  </code></pre>
  
  <p>It works if a use enters one value at a time. But what if the user gets opens a form with prepopulated values, to edit them. How would I check for duplicates then?</p>