I have a php site that displays table information from MySQL DB. I created a js that will pop-up upon clicking the row table. The problem is it will only function on the first row and nothing for the rest of it. And also I wanted to display the captured information from the row where it was clicked to the popup/dialog box. Thank you!
Here's my Table
<tr id="popup" style="cursor: pointer;">
<td hidden="text"><?php echo odbc_result($result,"OBGyneID"); ?></td>
<td><?php echo odbc_result($result,"Lname"); ?>
, <?php echo odbc_result($result,"Fname"); ?>
<?php echo odbc_result($result,"mi"); ?></td>
<td class="hidden-ob-xs"><?php echo odbc_result($result,"Bday");?></td>
<td class="hidden-ob-xs"><?php echo odbc_result($result,"pxAge"); ?></td>
<td class="hidden-ob-xs hidden-ob-sm"><?php echo odbc_result($result,"PhoneNum"); ?></td>
<td><?php echo odbc_result($result,"service"); ?></td>
<td class="hidden-ob-xs hidden-ob-sm"><?php echo odbc_result($result,"obgyneTime"); ?></td>
</tr>
Here's my JS
$('#popup').click(function(){
swal({
title: 'Are you sure you want to delete this record?',
text: 'You will not be able to recover this record again!',
type: 'warning',
showCancelButton: true,
buttonsStyling: false,
confirmButtonClass: 'btn btn-danger',
confirmButtonText: 'Yes, delete it!',
cancelButtonClass: 'btn btn-light',
background: 'rgba(0, 0, 0, 0.96)'
}).then(function(){
swal({
title: 'Are you sure?',
text: 'You will not be able to recover this imaginary file!',
type: 'success',
buttonsStyling: false,
confirmButtonClass: 'btn btn-light',
background: 'rgba(0, 0, 0, 0.96)'
});
});
});