Thanks Dave!

The page reloads because of the wrong text entered into the captcha text input 
box.
( <cfform action="#cgi.script_name#" method="post">)

I'm using this code below for the email address:

<!--- Remember this forms email address if captcha is wrong only--->
 <cfif isDefined("FORM.toAddress")>
 <cfset SESSION.address = FORM.toAddress>
 <cfset toAddressPreFill = FORM.toAddress>

<!--- Pre fill to address form after captcha is wrong --->
<cfelseif isDefined("SESSION.address")>
 <CFSET toAddressPreFill = SESSION.address>

<!--- Show empty string the first visit --->
<cfelse>
 <cfset toAddressPreFill = "">
</cfif>
<!---End  --->

     <cfinput type="text"
     name="toAddress"
     value="#toAddressPreFill#"
     message="You must provide an email address ([email protected])"
     validateat="onSubmit,onServer"
     validate="email"
     required="yes"
     size="50">

This is working perfect but not working for checkboxes.

>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
>
>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
>
>        
>> (o o)
>> ----ooO--(_)--Ooo----------------------------------------------
>> John Barrett
>> Manager Hawaii Flash User Group 
>> Flash Design & Development
>> http://www2.hawaii.edu/~johnbarr
>> 
>.
>> oooO
> 
>> (  )   Oooo.
>  
>> \ (   (   )
>   
>> \_)   ) / 

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