> I have a dynamic form with multiple checkboxes. They are
> named checkbox1, checkbox2, checkbox3, etc. I am using this
> to loop through and get the value of each:
>
> <CFSET VARIABLES.var_name = "FORM.text" & VARIABLES.index>
> <CFSET VARIABLES.default_value = Evaluate(VARIABLES.var_name)>
> <CFSET VARIABLES.text =
> SetVariable(VARIABLES.var_name,VARIABLES.default_value)>
>
> The problem is when the checkbox is not checked and no value
> is passed. Has anyone done anything like this before? Any help
> would be greatly appreciated.

You need to use IsDefined to check for the form variable's existence.
Assuming your checkboxes were named "checkbox1, checkbox2":

<CFIF IsDefined("Form.checkbox" & Variables.Index)>
...
</CFIF>

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to