I need to end up with a parent array that has several child arrays to be able to send it in through an ajax post.
My html:
<tr class="row"> <td><input type="text" /></td> <td><input type="date" /></td> <td><input type="number /></td> <td><input type="number /></td> </tr> <tr class="row"> <td><input type="text" /></td> <td><input type="date" /></td> <td><input type="number /></td> <td><input type="number /></td> </tr> My javascript:
var detail = new Array() $("tr.line").each(function(){ var row = new Array(); $("tr.line input").each(function(){ row.push(this.value); }); detail.push(row); }); But this isn't doing what I need it to do
detail = array( row = array( text: ..., date: ..., number: ..., number: ... ) row = array( text: ..., date: ..., number: ..., number: ... ) )
detail."tr.line"- well, you don't have anytrwith classline- so you wont get much with your code - perhaps you meant"tr.row"what I need it to do- you need the rows array to be an array of objects, not an array of arrays