title: How to get selected values of checkboxes in DataTable of different pagination pages PHP and javascript?
body: <p>Basically I have a dataTable that displays all the records from the database, and a checkbox for each row within the table. My table has multiple pages. The problem was that I can only get the checkbox values of the current page selected because the system can only see checkboxes that are visible. I want to get specific checked values or all checked values from different pages and push them to the array. How can I achieve this? I can only get the checked value of current selected page in datatable atm. I have searched and tried <a href="https://stackoverflow.com/questions/30723911/checkboxes-will-only-work-on-current-pagination-page-in-jquery-datatables">similar problem</a>, but it's still not working.</p>
  
  <p>Below is my code</p>
  
  <p>PHP code to display checkboxes</p>
  
  <pre><code>foreach($stmt as $row){echo "&lt;tr&gt;&lt;td&gt;"."&lt;input type='checkbox' name='check_list' id='checklist' value='$row['id']' style='width:20px; height: 20px'/&gt;"}   
  </code></pre>
  
  <p>Javascript code</p>
  
  <pre><code>function getCheckboxVals(){
  
      var check = $('input[name="check_list"]:checked').length;
      var mycheckboxes = new Array();
  
      //IF NO CHECKBOX CHECKS
      if(check == 0){
          eModal.alert('PLEASE SELECT ISSUES BEFORE YOU EXPORT CONTENTS!!!');
          return false;
      }
  
      //IF ONE OR MORE CHECKBOXES CHECK
      if(check == 1){
          $('input[name="check_list"]:checked', table.fnGetNodes()).serialize().each(function(){
  
          mycheckboxes.push(this.value);
  
      });
  }else{
      $('input[name="check_list"]:checked').each(function(){
  
          mycheckboxes.push(this.value);
  
      });
  }
  </code></pre>
  
  <p>}</p>