I’m trying to push values into specific elements by creating a multidimensional array:
var rate_info = [];
rate_info[0].push($("#title-textarea"+id).val());
rate_info[0].push($("select[name=category"+id+"]").val());
rate_info[0].push($("select[name=subcategory"+id+"]").val());
...
data: {
"rate_info" : rate_info,
},
...
but this breaks my script and I’m not sure what I’m doing wrong
No need in indexing, just push to the array:
Otherwise you need to create a new array first to be able to push elements to it: