title: Needs to pass array values from javascript to php controller in Code Igniter
body: <p>I have this javascript that stores able values in an array:</p>
  
  <pre><code>&lt;script&gt;
  $(function(){
      $('#preview').click(function(){
      var thesum=0;
      var rowid=[];
      var rowfields=[];
      var supplier = document.getElementById("sid").value;
      var terms=document.getElementById("terms").value;
      var podate=document.getElementById("date1").value;
      var reqdate=document.getElementById("date2").value;
      var contp=document.getElementById("contactp").value;
      var count = ($('#listOfProducts tr').length);
      //loop start
      var i=0;
      grid=$('#listOfProducts input[type="checkbox"]:checked').each(function(){
      var $row = $(this).parents('tr'); 
      var $trid =$(this).closest('tr').attr('id');
      rowid[i]=$trid; 
      rowfields.push({itemname: $row.find('td:eq(0)').text(),       productname:$row.find('td:eq(1)').text(), productdesc: $row.find('td:eq(2)').text(), unitprice:$row.find('td:eq(3)').text(), quantity:$row.find('td:eq(5) input').val(), amount:$row.find('td:eq(6) input').val()});
      i++;
      });//each close 
  
  var dataString = JSON.stringify(rowfields); 
     });//preview click close
   });//function close
   &lt;/script&gt;
  </code></pre>
  
  <p>i need to pass the rowfields array to my controller so i can start manipulating the data on other functions. Can you please help me with this? </p>