function Save() {
var count = $("#count").val();//count to iterate
var obj = {}
for (var i = 0; i < count ; i++) //iterating for each set of id's
{
obj = {
chckaids : $("#chckaids" + i).val(),
size : $("#size " + i).val(),
freq : $("#freq" + i).val(),
control : $("#control " + i).val(),
plan : $("#plan" + i).val(),
type : $("#type").val(),
qty : $("#qty").val(),
rejected : $("#rejected ").val(),
remark : $("#remark").val()
}
}
$.ajax({
url: "../SaveQCInspection",
type: "Post",
data: JSON.stringify([obj]),
contentType: 'application/json; charset=utf-8',
success: function (data) {
},
error: function () { }
});
}
I need to get all the values in the dynamic id's and pass it to ajax as single object...Experts told me to use Json-model,I googled but still didn't get any idea about that.....Please guide me whether it is easy to use json model or it is the only way to acheive this ...
Thank you in advance.....:)