> I'm creating an Event management application in which an administrator
> can insert in a table a row per Seminar including Date, Location,
> SeminarName based on checkboxes from the seminar table.  My problem is
> that when my query is adding each row, it quits with the following error
> when it hits the first checkbox that remained blank:
<CF_Snip_Rest_Of_Message>

OK, HTTP doesn't pass a value for an empty check box, so you have to CFParam
it or so an isDefined() on it

Quickest way is to loop over your checkbox names and CFParam them all to
blank - not the prettiest, but the quickest to code

Oh, and before anyone comes up with a "What's the prettiest then";

<cfscript>
variables.FormFieldArray=ListToArray("Field1,Field2,Field3");
for (variables.FormFieldCount=1; variables.FormFieldCount lte
ArrayLen(variables.FormFieldArray);
variables.FormFieldCount=variables.FormFieldCount+1)
{  if (not
isDefined("form.#variables.FormFieldArray[variables.FormFieldCount]#"))

SetVariable("form.#variables.FormFieldArray[variables.FormFieldCount]#","");
}
</cfscript>

In CF4.5.1 SP2 that should run faster than

<cfloop index="variables.FormFieldEntry" list="Field1,Field2,Field3">
        <cfparam name="form.#variables.FormFieldEntry#" default="">
</cfloop>

and be less white-spacey

Philip Arnold
Director
Certified ColdFusion Developer
ASP Multimedia Limited
T: +44 (0)20 8680 1133

"Websites for the real world"

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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