okay, i got it working...
posting in case it helps anyone else:
var jArray= <?php echo json_encode($csv_output); ?>;
var d = [];
jQuery('.ckbox').change(function() {
if(this.checked) {
var id = jQuery(this).attr('id');
var n = id.charAt(id.length-1);
d.unshift(jArray[n-1]);
} else {
d.shift(jArray[n-1]);
}
jQuery('#csv').val(d.join(' '));
});
basically, as you can see, i assigned my php array to a javascript array (using json_encode() ), and then if the box was checked, i added it to the array (or removed it if was unchecked)...
then i turned it into a string and assigned it to the form's hidden input (id=csv). value...which let me posted correctly..yah!
hope that's clear : )