php - Ajax try to update data from table but in other lines not work

I update data information by an ajax on change in a table but just work with the first line, with the other lines did not work, this is my ajax:
$(document).ready(function(){
$('#table').on('change', 'input', function () {
var test={
"test1": $("#test1").val(),
"test2":$("#test2").val()
}
$.ajax({
method: "POST",
url: "data.php",
data: alta,
async:true,
cache:false,
success : function(response){
if(response=="1"){
alert("done");
}
else{
alert("sad");
}
},
error : function(error) {
alert(error);
}
});
});
});
How can I update the other lines in the table?
Answer
Solution:
You must specify the rows with unique id or you need to user this keyword for get the particular row of data.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: target class [commandmakecommand] does not exist.
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.