My guess is that you are setting the session variable based on the
existence of the form.fstate variable...which won't exist if none of
the check boxes are checked. On the submit page for the form, you
really only need two things to make this work...

<cfparam name="form.fstate" default="">
<cfset session.fstate = form.fstate>

On 3/20/06, Jeremy Bunton <[EMAIL PROTECTED]> wrote:
> I have several forms that have check boxes. I set the vales of the
> checkboxes to sessions after the form is submitted so that a user can surf
> around the site and come back and change their selections. The code I use is
> below and it sort of works - but not really. Its checks to see if the value
> is in the session and checks the box if it is. The problem is if someone
> unchecks all the boxes and hits submit. Though the box was unchecked by the
> user the code below says it was and hence one value always gets posted back
> to the session and it resets itself and checks a box.
>
> <cfif #trim(session.fstate)# contains #trim(stateabbr)#>
> <input type="Checkbox" name="fstate" value="'#trim(stateabbr)#'"
> checked>#state#<br>
> <cfelse>
> <input type="Checkbox" name="fstate" value="'#trim(stateabbr)#'">#state#<br>
> </cfif>
> </cfoutput>
>
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:235774
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to