You have to have some knowledge of the checkbox names.
Are they in any way similar?
<input type="checkbox" name="checkbox_1" />
<input type="checkbox" name="checkbox_2" />
<input type="checkbox" name="checkbox_3" />
If so, you can check in a loop:
<cfloop from="1" to="3" index="i">
<cfif IsDefined("FORM.checkbox_#i#")>
<!--- We have a winner --->
</cfif>
</cfloop>
Or if you don't want to limit the loop:
<cfloop condition="IsDefined('FORM.checkbox_#i#')">
<!--- We have a winner --->
<cfset i++>
</cfloop>
Adrian
-----Original Message-----
From: Mallory Woods [mailto:[EMAIL PROTECTED]
Sent: 01 October 2008 16:41
To: cf-talk
Subject: Form Challenge?
What is the best way of coding this: I have a form that currently has 4
check boxes.
When processing this form I need to check for the existence of any of the
check boxes.
Now, there are 4 values now but there could be more in the future.
I tried to loop over the form variable with "isdefined" by I ran into
problems as I won't always know the
name of the check box to check.
Any suggestions on how to approach this problem?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:313338
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4