Good idea - FYI - you don't need the # signs around a variable you use
explicitly within a tag like this:

<cfif form.all eq "no">

This is faster than <cfif #form.all# eq "no"> and easier to read.

If you are using the variable within an 'attribute' of a tag like this:

<cfinput type="text" name="whatever" value="#form.whatever#">

Then you DO need the variable inside the # signs.  If it's inside quotes,
then you MUST have the # signs, if it's outside of quotes, but still inside
of a CF tag, then you don't need pound signs...

Glad to hear it's working for you now!

Dave

-----Original Message-----
From: Barry Mcconaghey [mailto:[email protected]] 
Sent: Wednesday, July 15, 2009 11:55 AM
To: cf-newbie
Subject: Re: Session Variables


HOLLY COW !

Perfect...

When I rec. the email, the checkbox would say, "yes" or "no".

I changed it to:

<cfif #FORM.all# EQ "no">
Not All 50 states
<cfelse>
All 50 States
</cfif>

Coldfusion or I call it confusion sometimes.

Thanks,

Barry

>Make it:
>
><cfinput type="checkbox" name="all" checked="#form.all#" value="yes">
>
>The default value for a checkbox, if checked, is 'on'.  We need it to be
>'yes' instead, so we set it explicitly.  Now when the form reloads, checked
>will be 'yes' if it was already checked and 'no' (from the <cfparam> tag at
>the top) if it wasn't checked.
>
>Almost there!
>
>Dave
>
>I'm rec. this error if the checkbox (name="all") is checked and I type the
>wrong captcha letters or numbers.
>
>cannot convert the value "on" to a boolean 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:4639
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to