Building a delete record page – Adobe Dreamweaver CC 2014 v.13 User Manual
Page 566

Building a delete record page
About record delete pages
Search for the record to delete
Create links to a delete page
Build the delete page
Add logic to delete the record
Note: The user interface has been simplified in Dreamweaver CC and later. As a result, you may not find some of the options described in this
article in Dreamweaver CC and later. For more information, see
.
About record delete pages
Your application can contain a set of pages that lets users delete records in a database. The pages normally consist of a search page, a results
page, and a delete page. A delete page is usually a detail page working in tandem with a results page. The search and results pages let the user
retrieve the record and the delete page lets the user confirm and delete the record.
After creating the search and results pages, you add links on the results page to open the delete page and then build a delete page that displays
the records and a Submit button.
Search for the record to delete
When users want to delete a record, they must first find that record in the database. Accordingly, you need a search and a results page to work
with the delete page. The user enters search criteria in the search page and selects the record on the results page. When the user clicks the
record, the delete page opens and displays the record in an HTML form.
Create links to a delete page
After creating the search and results pages, you must create links on the results page to open the delete page. You then modify the links to pass
the IDs of the records the user wants to delete. The delete page uses this ID to find and display the record.
To create the links manually
1. On the results page, create a column in the table used to display records by clicking inside the last table column and selecting Modify >
Table > Insert Rows or Columns.
2. Select the Columns option and the After Current Column option, and click OK.
A column is added to the table.
3. In the newly created table column, enter the string Delete in the row containing the dynamic content placeholders. Make sure you enter the
string inside the tabbed repeating region.
You can also insert an image with a word or symbol for delete.
4. Select the Delete string to apply a link to it.
5. In the Property inspector, enter the delete page in the Link box. You can enter any filename.
After clicking outside the Link box, the Delete string appears linked in the table. If you Live view, you can see that the link is applied to the
same text in every table row.
6. Select the Delete link on the results page.
7. (ColdFusion) In the Link box in the Property inspector, add the following string at the end of the URL:
?recordID=#recordsetName.fieldName#
The question mark tells the server that what follows is one or more URL parameters. The word recordID is the name of the URL parameter
(you can make up any name you like). Note the name of the URL parameter because you'll use it in the delete page later.
The expression after the equal sign is the value of the parameter. In this case, the value is generated by a ColdFusion expression that
returns a record ID from the recordset. A different ID is generated for each row in the dynamic table. In the ColdFusion expression, replace
recordsetName with the name of your recordset, and replace fieldName with the name of the field in your recordset that uniquely identifies
each record. In most cases, the field will consist of a record ID number. In the following example, the field consists of unique location codes:
559