title: How to post id on checkbox in Jquery?
body: <p>I want to make a simple pagination page. This is regarding delete function. I have a checkbox that user can choose to delete a row. May I know how to <em>post/get</em> the id of the row if user click on next link? In my case, the id will be duplicate if user click on the checkbox. Below are my codes,</p>
  
  <p><strong>jQuery</strong></p>
  
  <pre><code>var cbNew = [],
  cbAdd = [];
  
  function addId(checkBox){
      cbAdd = cbAdd.concat(checkBox);
      console.log(cbAdd);
  }
  
  $(document).on("click", ".checkBox", function(){
      var cb = [];
      $('.checkBox:checked').each(function(){
          cb.push($(this).val());
      });
  
      if(cb.length &gt; 0) { 
          addId(cb);
          $('#delete').fadeIn(); 
      } else {
          $('#delete').fadeOut();
      }
  });
  
  //Link on Next Page
  $(".nextPage").click(getFunct);
  
  function getFunct(e){
      e.preventDefault();
      var url = $(this).attr('href'),
      row = getURLParameter(url, 'startrow'),
      cbNew = cbNew;
      getParam(row,url);
  }
  
  function getParam(param1,param2){
      $.ajax({
          type: "POST",
          url: url,
          data: 
          {
              row : param1,
              url : param2,
              cbNew : cbNew
          }
      }).done(function(data){
          $('#result').html(data);
          addId(cbNew);
      });
  }
  </code></pre>
  
  <p>This is the output if I click on multiple checkbox on same page <code>console.log(cbAdd);</code></p>
  
  <pre><code>["25", "25", "26", "25", "26", "27"]
  </code></pre>
  
  <p>If I click one checkbox on page 1 and one checkbox on page 2, it get the id correcltly</p>
  
  <pre><code>["25", "59"]
  </code></pre>