You may have a hidden field on the page that is updated with each row identifier in some limited list. Using jQuery, you can easily add a click event for each row that will add an identifier to a hidden field on the client. After clicking a row of lines, the hidden field may look something like "3.65,245,111"
Here is some jQuery to get you started. This will assign a click event for each row of the table with the identifier "myTable":
$(document).ready(function() { $('#myTable tr').click(function() {
The above will make it so that you can handle every time a row is clicked. You need to write some code and be creative to figure out how to get the id of the clicked string.
A separate “delete all lines” button will take a value in a hidden field, divide the line into each comma and then delete each line one by one.
There are many different ways to trick this cat, and above is a quick and easy way to complete the task.
source share