I always CFPARAM the checkbox var to blank (default="").  Then I add a case statement 
to where I'm
going to add it;

<cfif NOT len(MyCheckboxVar)>
  NULL,
<cfelse>
  #MyCheckboxVar#
</cfif>

I think your method evaluates attributes.chkOption to a string of NULL and not a NULL 
value ;-)

HTH

Bryan Stevenson B.Comm.
VP & Director of E-Commerce Development
Electric Edge Systems Group Inc.
t. 250.920.8830
e. [EMAIL PROTECTED]

---------------------------------------------------------
Macromedia Associate Partner
www.macromedia.com
---------------------------------------------------------
Vancouver Island ColdFusion Users Group
Founder & Director
www.cfug-vancouverisland.com

----- Original Message -----
From: "Douglas Brown" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, July 02, 2002 10:32 AM
Subject: Working with empty lists


> I have a group of checkboxes that I am converting into a list, but I
> would like it to where if the person does not check any of the boxes,
> that it at least puts the value of NULL into the DB. As you can see I
> have tried <cfparam> but that does not work for lists I suppose.
>
> <cfparam name="attributes.chkOption" default="NULL">
>
>    <!---Insert the options into the options table//--->
>   <cfloop list="#attributes.chkOption#" index="j" delimiters=",">
>    <cfquery datasource="#request.site.dsn#" name="insert_options">
>    DECLARE  @maxid int
>    BEGIN
>     SELECT  @maxid = MAX(ID)
>     FROM   options
>     IF    @maxid IS NULL
>     SELECT   @maxid = 1
>     ELSE
>     SELECT   @maxid = @maxid + 1
>    END
>
>    DECLARE  @max_inv_id int
>    BEGIN
>     SELECT  @max_inv_id = MAX(ID)
>     FROM   inventory
>    END
>    INSERT INTO options ( id,
>          inventory_id,
>          option_id )
>
>    VALUES    ( @maxid,
>           @max_inv_id,
>          #j#  )
>
>
>    </cfquery>
>   </cfloop>
>
>
>
>
> Douglas Brown
> Email: [EMAIL PROTECTED]
>
> 
______________________________________________________________________
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/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to