Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access variable through index

Status
Not open for further replies.
Aug 4, 2003
12
0
0
US
I have fields defined based on a number that is keyed in, for example if i = 10 where i is an input field then the fields would be defined as <input name="field#i#">
which would result in field1, field2, --- field10. Is there a way to access these fields on the next page using the same loop? I tried several options nothing worked.

Thanks.
 
on the form page make a hidden field with the number of fields looped
than on the action page loop that many times...


<cfloop from 1 to #form.count# index=i...

the value of each form can be accessed like #form["field" & i]# since the form scope is a structure, you can use the bracket notation or dot notation.

Kevin

Phase 1: Read the CFML Reference
Phase 2: ???
Phase 3: Profit!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top