Skip to main content
Known Participant
March 26, 2009
Question

Delete confirmation page

  • March 26, 2009
  • 1 reply
  • 332 views
I have added a DELETE text link in my repeating region table for deleting records. I have followed many online tutorials on how to add a safety "confirmation" page in case the user clicks DELETE accidentally, however everything I have tried I'm still not getting the confirmation page to work. When I arrive at the delete confirm page, I click the Delete button but the data in the fields just disappear, and I don't get sent back to the original page. If I manually go to the master page, the record is still there.

Here are my steps:
- On master page, create column and add DELETE text in repeat region

- Link DELETE text to delete.php page with parameters: Name: deleteID, Value: <?php echo $row_rs_All['recordID']; ?>

so the whole URL looks like: delete.php?deleteID=<?php echo $row_rs_All['recordID']; ?>

- On delete.php page I create a Recordset called Recordset1 with all columns selected from the table and Filter: recordID = URL parameter deleteID (to bring up the currently selected record)

- then I create a form and insert a table to display all the fields in the table so the user can see the data that is about to be deleted.

- in the form I create a hidden dynamic text field with id="formDelete" and link it to <?php echo $row_Recordset1['recordID']; ?> via the lightning bolt.

- I add a delete button within the form set to submit, method is Default

- Lastly I insert a Delete Record behavior. Parameters are as follows:
First check if variable is defined: Form Variable - formDelete
Connection and Table are as usual
Primary key column: recordID (numeric checked)
Primary key value: URL Parameter - deleteID
After deleting, go to: index.php

This topic has been closed for replies.

1 reply

Inspiring
March 26, 2009
sjurick wrote:
> - Lastly I insert a Delete Record behavior. Parameters are as follows:
> First check if variable is defined: Form Variable - formDelete
> Connection and Table are as usual
> Primary key column: recordID (numeric checked)
> Primary key value: URL Parameter - deleteID
> After deleting, go to: index.php

The form variable is called formDelete, but the URL parameter is set to
deleteID.

A better way would be to keep the variable deleteID all the way through.
With a delete operation, it's also advisable to use the POST method, in
which case, you get the Primary key value from Form variable, not URL
parameter.

--
David Powers
Adobe Community Expert, Dreamweaver
http://foundationphp.com