Oh duh... I hate it when that happens -- was in a hurry, didn't read all the
way through the first message...

Yea, your <cfparam> tag needs to specify the form scope... otherwise it will
create a local variable called #variables.myvariablename# instead of a form
variable, so when you attempt to use #form.myvariablename# later in the page
it still won't exist. If you want to make it easy on yourself, you can even
put your form fieldnames in a list and param them using the list variable,
i.e.

<cfloop index="x" list="A,B,C">
<cfparam name="form.display#x#" type="boolean" default="NO"></cfloop>

> Try scoping the variable in your cfparam:
> <CFPARAM NAME = "form.displayA" DEFAULT = "No">


> tim P.

> -----Original Message-----
> From: Gilbert Midonnet [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, September 11, 2002 6: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







> __________________________________________________________
> ____________
> This list and all House of Fusion resources hosted by
> CFHosting.com. The place for dependable ColdFusion
> Hosting.
> 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


Isaac
Certified Advanced ColdFusion 5 Developer

www.turnkey.to
954-776-0046

______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
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

Reply via email to