Onclick event on Multiple button
I have a PHP page that display multiple records in an HTML table. For
every row there is a Delete and Save button. When I click the Delete
and Save button on the first row, the record is correctly deleted and
saved. However, I click the button from 2nd row and above, it's now
working. Some how it's only activating the first row buttons only. I
appreciate any help on this.
$("#save").click(function(){
var tag_id = $("#tag_id").val();
var tag = $("#tag").val();
var tag_url = $("#tag_url").val();
var url = 'save=1&tag_id=' + tag_id + '&tag=' + tag + '&tag_url=' +
tag_url;
alert("tag_id=" + tag_id + "\n" + "tag=" + tag + "\n" + "tag_url=" +
tag_url);
if ((tag_id != null) && (tag != null) && (tag_url != null) &&
is_changed())
{
$.ajax({
type: "POST",
url: "aud_tag.php",
data: url,
success: function(){
Write_Status("Tag has been saved successfully.");
}
});
}
return false;
});
});