In kinda a combination of the ways that have been suggested, I do this.
I param all of the form field variables as soon as a user hits the page.
<cfset fieldlist = "name, address, whatever">
<cfloop list="#fieldlist#" index="i">
<cfparam name="form.#i#" default="">
</cfloop>
<input type="checkbox" name="whatever" value="val" #IIF(form.whatever =
'val', DE("checked"), DE(""))#>
I then submit the results to the same page and do my validation at the top
or in an include. If the info passes validation I cflocate to the next page.
If not, the form is displayed again, but this time since the variables are
already there the fields are not paramed and you never loose what the user
typed.
If you need a sticky form, queries are cooler instead of cfparam, because a
query that returns no result will still return null values for all the the
fields.
jon
----- Original Message -----
From: "Ang�l Stewart" <[EMAIL PROTECTED]>
To: "CF-Community" <[EMAIL PROTECTED]>
Sent: Wednesday, May 23, 2001 1:47 PM
Subject: Recalling the state of radio buttons...
> How do I remmeber the state of radio buttons or CheckBoxes??
>
> I have two radio buttons corresponding to Gender..
>
> So if I submit the form and make an error and have to make a change on the
> form..what I want is for the form to reload with all the data that the
user
> previously entered.
>
> But how do you save the state of a radio button?
> How would you assign a value to it, so that when the form reloads say Male
> would still be checked?
>
>
> -Gel
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists