Robert Orlini wrote:

> I have a form where the from variable is incremented dynamically if
> there is more than one occurrence of the same field.
>
> The input name looks like this: name="qty#i#".
>
> The #i# is a number that increments according to how many fields are
> needed. In this instance, if I have more than one item, then the
> quantity field would be qty2, qty3, qty4, etc.
>
> How do I carry over this field as a form variable to the next form on
> a submit?
>
> I tried: #trim(form.qty#i#)# but it does not work. Somewhere I read
> the Evaluate function my help.
>
If I've follow what you are asking, and you want the form variables to
go into say hidden fields on the next form then you would do something
like this.

<cfloop list="#form.fieldnames#" index="thisFieldName">
   <cfoutput>
   <input name="#thisFieldName#" type="hidden"
value="#form[thisFieldName]#">#chr(13)#
   </cfoutput>
</cfloop>

If you're on cf5 or less then you probably (because I can't remember if
form scope is in a struct in CF5) need to use the following evaluate in
the value field of the input rather than the structure reference :

#evaluate("form."&thisFieldName)#

Regards

Stephen
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to