I have a dynamic table and when i add a row i want to save the data from input.
I can save the data but all inside an array,
i want to set just 3 values each array. Because one row have 3 inputs.
Can you help me please?
function arraySaveData() {
var data = [];
for (var index = 0; index < 1; index++) {
$('#mytableform1').each(function (_, element) {
var element = document.getElementsByName("namesavedata[]");
for (var i = 0; i < element.length; i++) {
data.push(element[i].value);
}
});
var result = [];
for(var i = 0; i < data.length; i++) {
var obj = {}
obj= data[i];
result.push(obj)
}
console.log(result)
}
}