title: jQuery - duplicate ajax queries
body: <p>Why there is a problem with select options?</p>
  
  <p>how to replicate:</p>
  
  <ol>
  <li>click on add button</li>
  <li><p>Try to change first select</p>
  
  <p>a. after the first change, nothing happens</p>
  
  <p>b. after second change, it runs ajax query</p>
  
  <p>c. after third change, it runs twice ajax query</p>
  
  <p>d. the fourth change, fires the same three questions...</p></li>
  </ol>
  
  <p>What is wrong? Where I made mistake?</p>
  
  <p>Here is <a href="http://jsfiddle.net/5qLfn/1/" rel="nofollow">jsfiddle</a></p>
  
  <pre><code>&lt;button type="button" class="btn btn-primary btn-sm" id='ql_add_case_schema'&gt;&lt;i class="fa fa-plus-square"&gt;&lt;/i&gt; Add case&lt;/button&gt;
  
  &lt;div id='ql_div_cases'&gt;&lt;/div&gt;
  
  $("#ql_add_case_schema").on("click", function () {
      var select  ='&lt;div&gt;';
  
              select +='&lt;select class="skill" name="skill"&gt;';
                  select +='&lt;option value="" selected&gt;--&lt;/option&gt;';
                  select +='&lt;option value="case1"&gt;Case 1&lt;/option&gt;';
                  select +='&lt;option value="case2"&gt;Case2&lt;/option&gt;';
              select +='&lt;/select&gt;';
  
              select +='&lt;select class="process" name="process"&gt;';
                  select +='&lt;option value=""&gt;--&lt;/option&gt;';
              select +='&lt;/select&gt;';
  
              select +='&lt;select class="reason" name="reason"&gt;';
                  select +='&lt;option value=""&gt;--&lt;/option&gt;';
              select +='&lt;/select&gt;';
  
  
              select +='&lt;select class="action" name="action"&gt;';
                  select +='&lt;option value=""&gt;--&lt;/option&gt;';
              select +='&lt;/select&gt;';
  
          select +='&lt;/div&gt;';
  
      $('#ql_div_cases').append(select);
  });
  
  /* For multiple jquery.chained.js */
  $('#ql_div_cases').delegate('select', 'change', function(){
          //console.log( 'click');
  
          $(".process").each(function() {
              $(this).remoteChained($(".skill", $(this).parent()), "pytania/getCases");
          });
  
          $(".reason").each(function() {
              $(this).remoteChained([
                  $(".skill", $(this).parent()),
                  $(".process", $(this).parent())
              ], "pytania/getCases");
          });
  
          $(".action").each(function() {
              $(this).remoteChained([
                  $(".skill", $(this).parent()),
                  $(".reason", $(this).parent()),
                  $(".process", $(this).parent())
              ], "pytania/getCases");
          });
  
  });
  </code></pre>