Here is the script:
Code: Select all
<Script Language="JavaScript">
function ConfirmChoice()
{
answer = confirm("Do you really want to delete this company?")
if (answer !=0)
{
location = "view_results.php"
}
}
</script>
<body>
etc......Code: Select all
<td>
<form action="view_results.php" method="post">
<input class="button" type="submit" value="Delete" onClick=" ConfirmChoice(); return false;">
<input type="hidden" name="delete_company" value="<?php echo $db_id; ?>">
</form>
</tdWhat I am trying to do is ask the user if they are sure that they want to delete the item. If they say ok, then it deletes, and displays a page that says "Company has been deleted!". If they press the cancel button then the popup window will just go away.