i'm getting the data from a form when it is submitted like this
values = {};
$("#myForm").submit(function(){
$.each($('#myForm').serializeArray(), function(i, field) {
if(field.name != 'r'){
values[field.name] = field.value;
}
});
return false;
});
The problem is that i want to do that multiple times and store all the data in the var values using field.name as a keys and the values as an array to compare it in php i would do values[field.name][] = field.value; is there any similar syntax in js ?