Thanks everyone for your help! I appreciate it! -----Original Message----- From: Everett, Al [mailto:[EMAIL PROTECTED]] Sent: Monday, October 07, 2002 2:00 PM To: CF-Talk Subject: RE: I lost my brain - checkboxes
I've done stuff where I also pass the universe of values as a hidden tag. So if you have: <cfloop query="qry"> <input type="checkbox" name="hotlead" value="<cfoutput>#SID#</cfoutput>"> </cfloop> I would also put: <input type="hidden" name="listofleads" value="<cfoutput>#ValueList(qry.SID)#</cfoutput>"> Now on your next page you'll have the SIDs that are checked as well as all the SIDs. Some simple list manipulation (and there are some good UDFs at cflib.org for that) and you'll have all you need. > -----Original Message----- > From: Tony Carcieri [mailto:[EMAIL PROTECTED]] > Sent: Monday, October 07, 2002 1:39 PM > To: CF-Talk > Subject: I lost my brain - checkboxes > > > Hi all, > > Sorry for the stupid post today but I cannot think. > > I have an input field on a form: > <input type="checkbox" name="hotlead" > value="<cfoutput>#SID#</cfoutput>"> > (SID is the primary key in the SQL 2K DB). > > then on the page: > <cfloop query="GetInfo"> > <tr> > <td><input type="checkbox" name="hotlead" > value="<cfoutput>#SID#</cfoutput>" <cfif Hot EQ 1>checked</cfif></td> > </tr> > </cfloop> > > So here is my problem. When a checkbox (or more) is checked, > I do this SQL > statement: > UPDATE survey SET Hot = 1 WHERE SID IN (10,17) and this works great. > However, if I deselect the checkbox I no longer have the SID: > UPDATE survey SET Hot = 1 WHERE SID IN 0 (makes sense the > value is the SID). > > So how do I do this? > I want to set the Hot field to 1 on only the SID when checked and if i > deselect it, then i want the field to be set to 0 on the SID > i deselect. The > default value in the Hot (bit) field is 0. > > Thanks, > Tony > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

