Barry,

Well, the question is "what" is causing your page to reload.  Is it a form
handler that you have created?  If so, in your form handler, you might have
some logic like this:

<cfif isDefined("form.checkall") AND captch_is_wrong>
        <cflocation url="contact_us.cfm?checkall=true">
</cfif>

Then, at the top of your contact_us.cfm page have this:

<cfparam name="url.checkall" default="false">

Then, for your checkbox:

<cfif url.checkall>
        <cfinput type="checkbox" name="checkall" checked>
<cfelse>
        <cfinput type="checkbox" name="checkall">
</cfif>

I don't think you can put the <cfif actually IN the <cfinput tag, but I do
not know as I never use those tags.  If you can, you could reduce the above
5 lines of code to:

<cfinput type="checkbox" name="checkall" <cfif url.checkall>checked</cfif>>

Again, I'm not sure you can do that as I don't use the <cfform> tags.

Dave Phillips

-----Original Message-----
From: Barry Mcconaghey [mailto:[email protected]] 
Sent: Tuesday, July 14, 2009 7:51 PM
To: cf-newbie
Subject: Re: Session Variables


Thanks Johnny!

Sorry...but your page has the same issue. If a visitor types the wrong
captcha text from the image, the page reloads but the previous check in the
checkbox does not reload. 

Barry

> Hi,
> I think that you will need to use sessions to remember from page to 
> page.
> I have a page here using this:
> http://76.12.170.145/NutritionATC/Contact/questions.cfm
> 
> It sends a e-mail with the chosen results that the user enters. Let me 
> know if this is helpful,and I can share the code.
> Johnny
> 
        
> (o o)
> ----ooO--(_)--Ooo----------------------------------------------
> John Barrett
> Manager Hawaii Flash User Group 
> Flash Design & Development
> http://www2.hawaii.edu/~johnbarr
> 
.
> oooO
 
> (  )   Oooo.
  
> \ (   (   )
   
> \_)   ) /
        
> (_/
> 
> 
> 
> 
> ----- Original Message -----
> From: Barry Mcconaghey <[email protected]>
> Date: Tuesday, July 14, 2009 2:18 pm
> Subject: Session Variables
> To: cf-newbie <[email protected]>
> 
> > 
> > Hello.
> > 
> > I built a contact_us.cfm page with a captcha image. The problem 
> > I'm having is with a checkbox. In the event a person type the 
> > wrong captcha image, the page reloads. How do I get CF to 
> > remember a previous page checkbox after the page reloads?
> > 
> > Example:
> > 
> > <cfinput type="checkbox" name="checkall">
> > 
> > I would like to use a session variable with checked="yes"
> > 
> > Regards. 
> > 
> > 




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