Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
JohnManhart #1
Loop Indexes in Form Names
See the following code:
I have form input tag names generate by a loop. For instance:
<!--- Page 1 --->
<cfset i=1>
<cfoutput>
<cfloop index="i" from="1" to="4">
<input type="text" name="form-input-name#i#" value="form-input-name#i#" />
<br />
</cfloop>
</cfoutput>
</form>
<!--- This outputs four text input fields, named: form-input-name1,
form-input-name2, form-input-name3, form-input-name4 --->
<!--- Page 2
I just want to output the user entered text. How do I do this?
--->
<cfoutput>
<cfloop index="i" from="1" to="4">
#form-input-name#i## <br /><!--- HOW DO I DO THIS? --->
</cfloop>
<cfoutput>
JohnManhart Guest
-
Retrieve Form Names and values
Is there a way to loop through a list of fields that have been submitted to a page?? I know how to do it in asp, but im new to CF. Also do you... -
CFMX 7 Creating Duplicate Form Names
I have a cfloop that creates multiple cfforms. CFMX 7 is generating the same form name for first two forms. This prevents diffferent validations on... -
form button names as variables
perhaps I am just a little tired, but I am having trouble with my form buttons. Firstly I name them like this name=\"round".$counter."heats\"... -
Loop form value
ImageGroup wrote: :: Hi :: :: I have a recordset with x amount of records. This is displayed in a :: table and each record has a text field which... -
Can you return the names of the form elements?
Robb Meade wrote: One way is to use a bubble sort, which will give acceptable performance on small (>100) data sets. dim ar, i , j, vTemp... -
dempster #2
Re: Loop Indexes in Form Names
Use the Evaluate function to create a dynamic variable or form field name.
-Paul
<cfoutput>
<cfloop index="i" from="1" to="4">
#Evaluate("form.form-input-name" & i)# <br>
</cfloop>
<cfoutput>
dempster Guest
-
Pete Thomas #3
Re: Loop Indexes in Form Names
actually you dont need to use evaluate
#form['form-input-name' & i]#
Pete Thomas Guest
-



Reply With Quote

