There are several way to do it. Explain what exactly do you want to do.
One idea is this:
Put a hidden form field in some cell (one for each row) with some default value (like "0" for example).
When link is clicked, a JS function is activated that changes the hidden field value (fior example to "1".
Then you can loop through all hidden fields and check their values.
It is easy - because you generate all HTML and you can control what you generating...
you can put something like...
<table>
<tr><td><a href="javascript: alert('row 1'); wondow.location='some_address_1';">LINK</a></td></tr>
<tr><td><a href="javascript: alert('row 2'); wondow.location='some_address_2';">LINK</a></td></tr>
</table>
if you want process click on current page
or
if you want process click on next page...
<table>
let me give more details:
I have a table with some columns and one column has a link. On click of this link I have to display the details of the current row in a child window. For that I have called a Javascript function to which I have passed the row number which I have obtained by the loop counter when I am building the Table contents.
Till this point every thing is fine, But I have a reorder functionality also where a user can select a row and enter the row number where the selected row has to be moved. For that I have used the in built function moveRow().
By using this I am able to move the row to the entered position. Now since the innerHTML is copied for each row, I still Have the row number of the old row, so When I click on the Link it displays the contents of the old row rather than the row in which the link is clicked.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.