Checkboxes return "on" or "off" if you do not define a value for the input
field.

You first have to checked if the checkbox exists and then if it was checked

Form Page:
<cfinput type="checkbox" name="foo">

Action Page:
<cfif isDefined("form.foo") and form.foo eq "on">

CF uses short circuit evaluation.  So if it doesn't exists, it will not be
tested for on or off.

Teddy


On 12/6/06, Doug Brown <[EMAIL PROTECTED]> wrote:
>
> How would you check if a checkbox was indeed checked within a <cfif>
> block?
>
>
>
>
>
> Thanks
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:263020
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to