Batch Deletes Made Simple
This tutorial, adapted from Chapter 15 of The Joy of Dreamweaver MX, explains how to enable batch deletes via check boxes in three simple steps.
The Joy of Dreamweaver MX: Recipes for Data-Driven Web Sites is a web developer's cookbook filled with dozens of "secret" recipes that DMXers can really sink their teeth into.
For more information, visit the book's companion web site, or read a sample chapter - "Uploads Made Simple" - on UDzone.COM.
Step 2: Cut and Paste the Hidden Form Field |
|
In Dreamweaver's Document window, right-click the hidden field, MM_recordId,
and choose Name. Press CTRL-X to cut the name
attribute and click OK.
Now right-click the check box and choose Name. Press CTRL-V
to paste MM_recordId into the Name text box and click
OK. Repeat these steps with the hidden field's value
attribute, cutting and pasting it into the check box. When you're finished,
delete the empty hidden field. Make sure not to delete MM_delete,
because Dreamweaver MX references it in the Delete Record code blocks:
If (CStr(Request("MM_delete")) <> ""
And CStr(Request("MM_recordId")) <> "") Then
NOTE: The
symbol, used above, indicates that the code should appear on a single line,
even though it wraps in the code listing.
Save your work. If you select the check box in the Document window and switch
to Code view (CTRL-`), the form element should look something
like this:
<input name="MM_recordId" type="checkbox"
value="<%= rsLinks.Fields.Item("LinkID").Value %>">
All that remains is to revise the SQL DELETE statement.
Download
Sample Code
Author of "The Joy of Dreamweaver MX: Recipes for Data-Driven Web Sites," Paul Newman is President of BRAVE NEW WURLD, a New York web design firm. He has a BA in English and Creative Writing from Binghamton University and an MFA in Film Production from the UCLA Department of Film, Television, and Digital Media.
Paul's computer experience dates back to 1985, when he bought one of the first Apple Macintosh computers in his senior year of college. He has been building web sites since 1997, and his clients include RaikaUSA.com, VoiceoverAmerica.com, Officetek.com, and BarbaraTyson.com.
See All Postings From P.R. Newman >>