Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82458

Passing table data to a button's href when clicked

$
0
0

I'm converting an existing php page to use DataTables because if its funky, groovy features. The DataTable contains multiple rows as the result of a database select. The user can click to select one DataTable row at a time. The first field in the row is 'id', the unique identifier for each table's row. With a row selected in the DataTable, one of several buttons is then pressed, for example Delete

The Delete button's existing code is:

<?php echo '<a href="delete.php?id='. $row['id'] . '" class="btn btn-danger pull-right"> Delete';?>;

Its purpose is to load and display the full data for the selected row id in another page which asks the user to confirm or cancel the deletion.

In the page's previous life, $row['id'] contained the row id, but it's not obvious to me how I capture this from the selected row in DataTables. How can I pass the selected row's 'id' to the button?


Viewing all articles
Browse latest Browse all 82458

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>