Use a CFPARAM on the page that receives the form submission and default the checkbox fields to FALSE. Because the checkbox does not get submitted if unchecked (ie, set to false), the receiving page handles it properly.
Chris Lofback Sr. Web Developer TRX Integration 28051 US 19 N., Ste. C Clearwater, FL 33761 www.trxi.com > -----Original Message----- > From: Yexley Robert D Contr Det 1 AFRL/WSI > [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, September 25, 2002 11:31 AM > To: CF-Talk > Subject: Properly handling checkboxes > > > I've got an HTML form that consists of mostly checkboxes. > Initially, when I tested submitting the form, it was giving > me problems for the checkboxes that were NOT checked. So I > figured, OK, I need to figure out some way to get the current > value of the checkbox, then go ahead and set it to checked, > and then I'll be able to submit the form. So I wrote a > little JavaScript function that loops through all of the > items in the form, if it's a checkbox, it checks whether or > not it is checked, and sets it's value, then it sets it to > checked, and then it submits the form. All well and good, > and actually does what I need it to do, IF the user ends up > being satisfied with the options that they checked. I'd like > to go ahead have the action template for the form also be a > confirmation page, which will allow the user to review the > options that they've checked, and then submit their options > to our database. My problem now though, is that if a user > realizes that they've inadvertently c! > hecked a box that they didn't mean to, or didn't check a box > that they needed to, I can put a link on that page so that > they can go back to the form and correct their options, but > when you just go back (using something like javascript: > history.go(-1) or something like that), now ALL of the > checkboxes are checked. Is there a better way (I'm sure > there must be, I just don't know what it is) to handle the > submission of forms with checkboxes, so that if a user has to > go back to the form and make changes, that it will set the > form back to what they had originally selected? Any thoughts > or ideas would be greatly appreciated. > > ::YEX:: > <)))>< > > /* > || Robert D. Yexley > || Oracle Programmer/Analyst > || Northrop Grumman IT > || Contractor - Wright Research Site MIS > || Det-1 AFRL/WSI Bldg. 45 Rm. 062 > || (937) 255-1984 > || [EMAIL PROTECTED] > || <)))>< > */ > > <<Robert D. Yexley (E-mail).vcf>> > > ______________________________________________________________________ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists