Assuming its for a single record. Something like this should do it.

<cfset acount=0>
<cfquery datasource="#db#" dbname="d">
         update atable
         <cfloop list="#form.fieldnames#" index="afield">
                 <cfset fvalue=evaluate("#afield#")>
                 'exclude any you don't want' like the submit button
                 <cfif comparenocase(#afield#, "SENT") neq 0>
                         <cfif acount eq 0> set <cfelse> , </cfif>
#PreserveSingleQuotes(afield)#=#PreserveSingleQuotes(fvalue)#
                                 <cfset acount=acount+1>
                 </cfif>
         </cfloop>
         where whatever
 </cfquery>-----Original Message-----
From: Peter Benoit [mailto:[EMAIL PROTECTED]]
Sent: 22 March 2001 14:20
To: CF-Talk
Subject: multiple checkbox submit?


Hi,

I have a form with many (30) checkboxes on it, and would like to be able to
update a database with information as to which checkboxes were checked.

Is there a relatively easier way to do this other than 30 cfif/cfelses?

thanks,
Peter
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to