My problem is that I am trying to give values to a multi-dimensional array but every thing after the first value is being returned as undefined. I'm doing this with the intention of turning it into a JSON string and saving it to local storage.
Here's the code:
if (typeof order == "undefined" || !(order instanceof Array)) {
var order = [];
}
var arlen = order.length;
order[arlen] = arlen;
order[arlen][0] = po;
order[arlen][1] = $('#orderform' + t + ' input[name*="eID"]').val();
order[arlen][2] = '<?php echo $_SESSION['id']; ?>';
order[arlen][3] = note;
for(q=0;q<len;q++){
if($('#orderform' + t + ' input[class*="check' + q + '"]').is(':checked')){
var amt = $('#orderform' + t + ' input[class*="amt' + q + '"]').val();
var eid = $('#orderform' + t + ' input[class*="check' + q + '"]').val();
order[arlen][4] = [eid, amt];
}
}
var adhoc = $('#adhoctable > tbody > tr').length;
if(adhoc > 0){
for(z=1; z<=adhoc; z++){
var aheid = $('#ahtr'+z.toString()+' > td.aheid').html();
var ahamt = $('#ahtr'+z.toString()+' > td.ahamt').html();
order[arlen][5] = [aheid, ahamt];
}
}
Thanks for any help you guys can give me.

New Topic/Question
Reply


MultiQuote




|