Operation Manual

To the top
pop-up menu.
6. In the Detail Page box, click Browse and locate the delete page.
7. In the Pass URL Parameter box, specify the name of your parameter, such as recordID.
You can make up any name you like, but take note of the name because you'll use it in the delete page later.
8. Specify the value you want to pass to the delete page by selecting a recordset and a column from the Recordset and Column
pop-up menus. Typically the value is unique to the record, such as the record’s unique key ID.
9. Select the URL Parameters option.
10. Click OK.
A special link surrounds the selected text. When the user clicks the link, the Go To Detail Page server behavior passes a URL
parameter containing the record ID to the specified delete page. For example, if the URL parameter is called recordID and the
delete page is called confirmdelete.asp, the URL looks something like the following when the user clicks on the link:
http://www.mysite.com/confirmdelete.asp?recordID=43
The first part of the URL, http://www.mysite.com/confirmdelete.asp, opens the delete page. The second part, ?recordID=43, is
the URL parameter. It tells the delete page what record to find and display. The term recordID is the name of the URL
parameter and 43 is its value. In this example, the URL parameter contains the record’s ID number, 43.
Build the delete page
After completing the page listing the records, switch to the delete page. The delete page shows the record and asks the user if they're sure they
want to delete it. When the user confirms the operation by clicking the form button, the web application deletes the record from the database.
Building this page consists of creating an HTML form, retrieving the record to display in the form, displaying the record in the form, and adding the
logic to delete the record from the database. Retrieving and displaying the record consists of defining a recordset to hold a single record—the
record the user wants to delete—and binding the recordset columns to the form.
Note: The delete page can contain only one record-editing server behavior at a time. For example, you cannot add an Insert Record or an
Update Record server behavior to the delete page.
Create an HTML form to display the record
1. Create a page and save it as the delete page you specified in the previous section.
You specified a delete page when you created the Delete link in the previous section. Use this name when saving the file for
the first time (for example, deleteConfirm.cfm).
2. Insert an HTML form on the page (Insert > Form > Form).
3. Add a hidden form field to the form.
The hidden form field is required to store the record ID passed by the URL parameter. To add a hidden field, place the
insertion point in the form and select Insert > Form > Hidden Field.
4. Add a button to the form.
The user will click the button to confirm and delete the displayed record. To add a button, place the insertion point in the form
and select Insert > Form > Button.
5. Enhance the design of the page any way you want and save it.
Retrieve the record the user wants to delete
1. In the Bindings panel (Window > Bindings), click the Plus (+) button and select Recordset (Query) from the pop-up menu.
The simple Recordset or DataSet dialog box appears. If the advanced Recordset dialog box appears instead, click Simple.
2. Name the recordset, and select a data source and the database table that contains the records that users can delete.
3. In the Columns area, select the table columns (record fields) you want to display on the page.
To display only some of the record’s fields, click Selected and choose the desired fields by Control-clicking (Windows) or
Command-clicking (Macintosh) them in the list.
Make sure to include the record ID field even if you won't be displaying it.
4. Complete the Filter section as follows to find and display the record specified in the URL parameter passed by the results
page:
From the first pop-up menu in the Filter area, select the column in the recordset containing values that match the value of
the URL parameter passed by the page with the Delete links. For example, if the URL parameter contains a record ID
number, select the column containing record ID numbers. In the example discussed in the previous section, the recordset
column called CODE contains the values that match the value of the URL parameter passed by the page with the Delete
links.
504