php - Delete Confirmation when click on link -


i have code inside while loop fetching data database. want show confirmation popup when delete link clicked.

echo "<td><a href='delete.php?id=" . $row['serial_no'] . "'>delete</a></td>"; 

how can done?

try out confirm function javascript, learn jquery fast possible , try seperate javascript html ;).

http://www.w3schools.com/jsref/met_win_confirm.asp

<td>     <a href="delete.php?id=<?php echo $row['serial_no'] ?>" id="a_id">         delete     </a> </td>  <script type="text/javascript">     $(function() {         $('td a#a_id').click(function() {             return confirm("are sure want delete this?");         });     }); </script> 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -