собственно вот код
$('body .frontend-setup-form #secure').click(function (e) {
e.preventDefault();
var json;
var shirts = [];
var shirt = [];
$('body .frontend-setup-form #sheet input').each(function () {
if($(this).val()!='') {
shirt['name'] = $(this).attr('id');
shirt['value'] = $(this).val();
shirts.push(shirt);
}
});
json={shirts:shirts}
console.log(JSON.stringify(json));
получаю
{"shirts":[[]]}
хотелось бы
{
"name":"patern",
"shirt": [
{
"name": "size1",
"value": "размер1"
},
{
"name": "size2",
"value": "размер2"
}
]
}