views:

33

answers:

1

i have a table and a hidden field inside a td in it which stores the primary key .while deleting the table row i like to retrieve this value and add it to another hidden field

i want to retrieve the data in hidden field for this deleted row ??

+1  A: 

When you delete the row, likely using .remove() you can still query it's elements, for example using .find() like this:

$(".delete").click(function() {
  var id = $(this).closest("tr").remove().find("input[type=hidden]").val();
  //do something with the ID
});

You can give it a try here

Nick Craver