You could put in a default value with cfparam, and leave the
form.variable unscoped(heresy!)
<cfparam name="your_checkbox" default="0">
#your_checkbox#
*
Ken Brocx
Senior Developer
Dealer Trade Group
(425) 452-3651
[EMAIL PROTECTED]
* *
-----Original Message-----
From: Gilbert Midonnet [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 11, 2002 3:15 PM
To: CF-Talk
Subject: checkbox -- insert to database problem
I'm having problems with checkboxes. I can't find what I'm doing wrong.
I've
read and reread my sources. I think I understand what to do -- but it
still
isn't working.
PROBLEM: The checkboxes works when they are selected but don't when not.
I
understand that unselected checkboxes do not pass a value. I thought
that
CFPARAM would solve the problem. No!!!
ERROR MSG below:
. Error resolving parameter <B>FORM.DISPLAYA</B><P><P>The specified
form
field cannot be found...
CODE:
My user-fills-out-form-page.cfm is
<cfform name="eventsCalendar" method="post" action="submitEvent.cfm">
<snip></snip>
<input type="checkbox" name="displayA" value="Yes">
<input type="checkbox" name="displayB" value="Yes">
<input type="checkbox" name="displayC" value="Yes">
<snip></snip>
</cfform>
My processing-page.cfm has
<CFPARAM NAME = "displayA" DEFAULT = "No">
<CFPARAM NAME = "displayB" DEFAULT = "No">
<CFPARAM NAME = "displayC" DEFAULT = "No">
<cfquery name="displayEvents" datasource="eventsCalendar">
INSERT INTO displayEvents
(displayA, displayB, displayC)
VALUES
('#form.displayA#','#form.displayB#','#form.displayC#')
</cfquery>
I must be missing something very simple. thanks for any clues.
gilbert midonnet
______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists