I am having trouble passing javascript arrays and other variables to my php controller. I am doing this in codeigniter. I have assigned some values on javascript like this:
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++;
});
i have to pass it to my controller so i could save the values to my database... Any help? I am thinking of storing this array as a session variable but I do not know how, considering the client-side and server-side issues.