Thanks Steve, but I am not sure what you mean by "column_name" in your
<cfquery> example.

I am using this to delete messages off a message board. When the
administrator views the messages, he/she is also given a "delete" check box
option with every message displayed (this is just a form field, there is no
field in the database for the "delete" check box). He/she can then select
the messages that they want deleted and press the submit button at the
bottom of the page.

When the page submits I need to transfer the NoticeID and the form.delete
field (if checked) to the actionDelete page. This is where I am having
trouble.

My code is below:

****** admin.cfm ******
<cfquery name="ListMessages" datasource="myDatabase" dbtype="ODBC">
SELECT *
FROM noticeboard
ORDER BY NoticeID
</cfquery>

<form action="notice_DeleteAction.cfm?NoticeID=#NoticeID#" method="post">

<p><table width="460" cellspacing="0" cellpadding="5"><cfoutput
query="ListMessages">

<tr>
<td bgcolor="##999999"><p class="sub">#Name#</td></tr>
<tr>
<td><p>Email: <a href="mailto:#Email#">#Email#</a>
<p>#Message#
<br><input type="checkbox" name="gone" value="gone"> Delete
<p>&nbsp;</td></tr>
</cfoutput></table>
<input type="submit" name="submit" value="submit"></form>


****** notice_DeleteAction.cfm ******
<cfquery name="DeleteNotice" datasource="myDatabase" dbtype="ODBC">
DELETE FROM Noticeboard
WHERE NoticeID = #NoticeID# AND ????? = #form.gone#
</cfquery>




-----Original Message-----
From: Steve Robson [mailto:[EMAIL PROTECTED]]
Sent: 12 April 2000 10:46 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Deleting Multiple Records?


If you set the name of all the check boxes to be the same, and the value of
each check box to be the unique identifier of the records you want to delete
from the database.  The form will send the value of the all the boxes that
have been checked as a list of values - "1,34,86,100" for example, you can
then use this form vairable in a cfquery:

<cfquery . . . .>
delete from table_name where column_name in #form.check_box_name#
</cfquery>

Steve

-----Original Message-----
From: David Crowther [mailto:[EMAIL PROTECTED]]
Sent: 12 April 2000 10:34
To: '[EMAIL PROTECTED]'
Subject: Deleting Multiple Records?


<CF_newbie> I was just wondering if there was a way of deleting multiple
records at the same time?

In my admin section of a current project, I would like to provide the option
of selecting multiple records (by check box?) and then deleting all of the
selected records at one click of the submit button.

Is this possible, and if so, how do I do it?

Many thanks...

_____________________
d a v i d   c r o w t h e r
w e b   d e v e l o p e r
s i t d . c o m

t  0044 1753 865 731
f  0044 1753 865 785
----------------------------------------------------------------------------
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
----------------------------------------------------------------------------
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to