I have a 2D array which I want to send to a php page with $.ajax.
This is the code which creates the array:
for (var i = 0; i<rowlen; i++) {
if (breakcheck) {
break;
}
for (var j = 0; j<=columnlen; j++) {
thtext = columnheads.eq(j).text();
current_td = $(newrows[i]).find("td").eq(j);
if (current_td.find("input").length >0) {
rowdata[i,thtext] = current_td.find("input").val().trim();
if (rowdata[i,thtext] =='') {
alert("You must complete all fields");
breakcheck = true;
break;
}
} else {
rowdata[i,thtext] ='nada';
}
}//inner loop
}//outer loop
The array is filled properly with the nested loops and the I use JSON.stringify to format it. However when the ajax call is made all that is sent is an empty object ([]). What's wrong?