I have what I thought was a simple function but I can’t figure out what I’m missing here. There error I’m getting is missing : after property id and it references:
var data = { "'" + $(this).attr('id') + "'" : "'" + $(this).val() + "'" };
Here’s the function:
function ArrayPush($group) {
var arr = new Array();
$group.find('input[type=text],textarea').each(function () {
var data = { "'" + $(this).attr('id') + "'" : "'" + $(this).val() + "'" };
arr.push(data);
});
return arr;
}
Try this: