A number of ways you could do this... Include all the form fields as url
variables in the cflocation tag _if_ you know they can't or won't enter very
much data in the fields on that form and default the form values to url
parameters, i.e. :

<cfparam name="url.phonenumber" type="string" default="">
<input type="text" name="phonenumber"
        value="#htmleditformat(url.phonenumber)#">


Or set the form variables to session variables prior to the redirect and
default the form variables to session variables:

<cflock scope="session" type="exclusive" timeout="10">
<cfset session.forms.contactinfo = duplicate(form)></cflock>
<cflocation href="blah blah">

<cflock scope="session" type="readonly" timeout="10">
<cfif isdefined("session.forms.contactinfo")>
<cfset structappend(form,session.forms.contactinfo)>
</cfif></cflock>

<cfparam name="form.phonenumber" type="string" default="">
<input type="text" name="phonenumber"
        value="#htmledtiformat(form.phonenumber)#">


Or -- create a form on the action page with all the values of the submitted
form and use javascript to submit it back to the previous page.


Or -- (my favorite) -- include the action page at the top of the form page
and default all the fields in the form to form variables... This way you
don't have to muck with any of the redirecting stuff -- fewer moving parts,
less likely to break. :)

<cfif isdefined("form.phonenumber")>
        <cfinclude template="myactionpage">
</cfif>

<form>
<cfparam name="form.phonenumber" type="string" default="">
<input type="text" name="phonenumber"
        value="#htmleditformat(form.phonenumber)#">


s. isaac dealey                954-776-0046

new epoch                      http://www.turnkey.to

lead architect, tapestry cms   http://products.turnkey.to

tapestry api is opensource     http://www.turnkey.to/tapi

certified advanced coldfusion 5 developer
http://www.macromedia.com/v1/handlers/index.cfm?ID=21816



> I have a CF form that checks whether a user selects at
> least one check box in the form after entering their
> contact information. If they do not select a checkbox it
> goes back and informs them to check at least on box. I use
> the cflocation tag to go back to the form, but it also
> clears their contact information.

> How do I keep their contact information so that they do
> not have to re-enter that portion? Do I include some
> hidden fields w/the data?

> Thanks for any help.

> Here is part of the code in the action page:
> <cfset counter = 0>

> <CFIF #FORM.ala# IS "ala"> <CFSET counter = counter +1>
> </CFIF><CFIF #FORM.tla# IS "tla"> <CFSET counter = counter
> +1>
> </CFIF><CFIF #FORM.acrl# IS "acrl"> <CFSET counter =
> counter +1>
> </CFIF><CFIF #FORM.sla# IS "sla"> <CFSET counter = counter
> +1>
> </CFIF>

> <CFIF Counter EQ 0>
> <CFSET session.error = "<strong>Please check at least one
> training session.</strong>">
> <CFLocation url="register.cfm">
> </CFIF>

> Robert Orlini
> HWW

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to