I am having a problem with this code. This code is generated with PHP that I wrote.
I have a form with two basic radio buttons to confirm deleting a record from a database. But I also want to add an extra popup box to confirm a second time, just to be 100% sure this record should be removed from the database.
I get a popup box when I click the button but it doesn't do anything. When the user clicks cancel on the popup box, I want nothing to happen at all. But when they click "Continue" I want the popup box to submit the form in its current state.
There is a lot of PHP and I'm not sure that I can even post all of it here, but this is the rendered page, so I think that is all that will be needed?
Its ok the customer data is displayed on this code, its a sample database to test. The data isn't real.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<link rel="stylesheet" href="includes/style.css" type="text/css" media="screen" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
var del = confirm("This action cannot be undone! Delete?");
if (del == true)
// redirect to delete page with confirmation
// Do Nothing...
<li><a href="index.php">Home Page</a></li>
<li><a href="customerPage.php">Customer Page</a></li>
<li><a href="ordersPage.php">Orders Page</a></li>
<li><a href="orderDetailsPage.php">Order Details Page</a></li>
<li><a href="totalsPage.php">Totals Page</a></li>
<div id="content"><!-- Start of the page-specific content. -->
<!-- Script 8.1 - header.html -->
<h1>Delete Customer</h1[B]<font color='"darkred"'>><form name="deleteCustomer" action="delete_customer.php" method="post">
<h3>Customer: Brown, Robert (Social Security Number: 556-22-1236)</h3>
<p>Are you sure you want to delete this customer?<br />
<input type="radio" name="sure" value="Yes" /> Yes
<input type="radio" name="sure" value="No" checked="checked" /> No</p>
<p><input type="button" name="submit" value="Submit" onClick="do_delete()" /></p>
<input type="hidden" name="submitted" value="TRUE" />
<input type="hidden" name="id" value="1004" />
</form></font>[/B]<!-- Script 3.3 - footer.html -->
<!-- End of the page-specific content. --></div>
<p>Copyright © 2010<br/></p>
To be clear:
- The user presses DELETE on another page, and is directed to the delete_confirm.php
- The customer information is displayed in a form.
- The message is shown "Do you want to delete this record".
- The user selects the "Yes" radio button and submits the form.
- One additional security the user gets a popup box "ARE YOU REALLY SURE?"
6a. The user clicks "Continue" and the page is submitted. (PHP will handle accessing MySQL)
6b. The user clicks "Cancel" and nothing happens. They just stay on the delete_confirm.php page.
The form works fine with the submit button, but I wanted to add just one popup box as extra security.