Bascially when a user hits the delete button, the script must confirm from user if he wants to delete or not. I want to pass the id of a row. I am using input type=”image” and onclick brings up the box. How do I pass $row_id[‘id] to the js script.
<script type="text/javascript">
function show_confirm()
{
var r=confirm("Do you want to delete");
if (r==true)
{
window.location = "delete.php";
//alert("You pressed OK!");
}
else
{
}
}
</script>
<input type="image" src='../images/delete.jpg' width='30px' height='30px' style="position:relative; top:0px;" onclick="show_confirm()">
and get id in javascript function,