Barry,

Okay, what you need to understand is that when you use CFFORM with
method="post", all your form variables will be in the 'form' scope.  When
you use CFFORM with method="get", all your form variables will be in the
'url' scope.

For what you are trying to do, I think you don't need this line:

<cfparam name="url.all" default="">

What you do need to do is in your 'form handling' section of code, you have
to look for existence of 'form.all' with isDefined("form.all") because if
the checkbox is NOT checked, the 'form.all' will NOT exist.

If you need help, post your code that is erroring out with a few lines
before and after.

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


Hi Dave.

The form works now. It will remember the visitors entry.

But if left unchecked, I'm getting an error message when email is sent ot
the captcha is correct.

<cfparam name="url.all" default="">

<cfinput type="checkbox" name="all" checked="#isDefined('form.all')#"> All
50 States

Regards,

Barry


>Barry,
>
>Try it the way Adrian suggested - much cleaner - and only one line of code:
>
><cfinput type="checkbox" name="all" checked="#isDefined('form.all')#">
>
>Also, check this - do you have a <cfparam name="form.all" default=""> line
>at the top of your code?  If so, that changes how you need to code the
>cfinput line.
>
>Dave
>
>Hi Dave.
>
>I added your code but it still does not save the visitors checkbox (All 50
>States)
>
><cfif isDefined("form.all")>
><cfinput type="checkbox" name="all" checked="yes">All 50 States
><cfelse>
><cfinput type="checkbox" name="all">All 50 States
></cfif> 
>
>Here is the link. Try typing the wrong captcha text and uncheck "All 50
>States".
>
>http://www.firefightingnews.com/contact_us_directory.cfm
>
>Thanks,
>
>Barry
>
>checked.
>>So, we check to see if it is defined and if it is, then we know the box
was
>>previously checked, and so we execute the cod that will display it as
>>checked.  If the form.checkall variable is NOT defined, then the checkbox
>>wasn't checked (or the form scope doesn't even exist, like on the first
>time
>>load of the page) and so we don't display it checked.
>>
>>Hope this helps.
>>
>>Dave Phillips 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:4630
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