Thanks Bobby,
I actually got it working using a slightly different approach, but your
idea is simpler (and I knew there was a simpler way to get this working)
Here's what I did. Inside the display cfoutput, I added 2 hidden fields
<input type="hidden" name="deletionID#qryNoticeboard.currentrow#"
value="#noticeboardID#" />
<input name="deleteNoticeboard#qryNoticeboard.currentrow#"
type="checkbox" value="Yes" />
Then after the cfoutput is closed but before the form ends, I set
another hidden field
<input type="hidden" name="boardCount"
value="<cfoutput>#qryNoticeboard.recordCount#</cfoutput>" />
so that I could use this for the query loop
And in the query
<cfloop index="i" from="1" to="#boardCount#">
<cfif isDefined("form.deleteNoticeboard"&i)>
<cfquery datasource = "#request.dsn#" name =
"qryDeleteNoticeboardItem">
UPDATE noticeBoard
SET active = No
WHERE noticeboardID = #form['deletionID'&i]#
</cfquery>
</cfif>
</cfloop>
This works but obviously overcomplicates the procedure. The advice is
appreciated and I will implement now..
Mark
-----Original Message-----
From: Bobby Hartsfield [mailto:[EMAIL PROTECTED]
Sent: Thursday, 15 September 2005 11:53 p.m.
To: CF-Talk
Subject: RE: Another radio button problem
You have an ID field for every single record. So yes, it's hitting them
all in your action query when you loop over that field. Give your
delete_noticeboard" field a value of the NoticeBoardID inside your loop.
On your form, change
<input name="delete_noticeboard" type="checkbox" value="Yes"> To
<input name="delete_noticeboard" type="checkbox"
value="#NoticeBoardID#">
At the top of your update query page, add this to ensure no error is
thrown when no boxes were checked <cfparam
name="form.delete_noticeboard" default="">
And in your loop, change
list="#form.ID#"
to
list="#form.delete_noticeboard#"
When you submit the form now, the #Form.delete_noticeboard# will hold a
comma delimited list of all of the selected check box values. (A comma
delimited list of all the NoticeIDs you want to delete)
Good luck.
...:.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:218470
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54