> I've got a form with a series of form fields whose names are dynamically
> generated in an indexed loop.  i.e.
>
> form.unit1_name
> form.unit1_listed
>
> form.unit2_name
> form.unit2_listed
>
> etc.
>
> One of these form fields is a checkbox and in the action template I want
> to default the value to "0" using CFPARAM, but I keep getting undefined
> variable errors.  I've tried the following (i is the index of a for loop):
>
> <cfparam name="form.unit#i#_listed" default="0">
> <cfparam name="Evaluate('form.unit#i#_listed')" default="0">
>
> Any ideas how to do this?

OK, now if you Evaluate the Name part of a CFParam, then it'll use the
contents of that field as the variable name, so;

<CFParam Name="form.unit#i#_listed" Default="0">
Will set form.unit1_listed to 0 if it doesn't exist, while;

<CFParam Name="#Evaluate('form.unit#i#_listed')#" Default="0">
Will set the value in the field form.unit1_listed to 0, i.e.
form.unit1_listed="myValue", then myValue would be equal to 0

If you want to ensure that the fields (as listed) appear, then use the first
one.

Philip Arnold
ASP Multimedia Limited
T: +44 (0)20 8680 1133

"Websites for the real world"

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************


------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to