evergreean43
Technical User
I have a action page that works where I am passing alot of form values. The below example is a condense version of all my form values:
I would like to do this a more efficient way such as putting the form fields and values into a loop but not sure how do to it correctly. Please advise how I can make the loop below work?
Code:
<cfoutput>
<form action="goto.cfm" method="post">
<input type="hidden" name="city" value="#form.city#">
<input type="hidden" name="state" value="#form.state#">
<input type="hidden" name="county" value="#form.county#">
<input type="hidden" name="section" value="#form.section#">
</form>
I would like to do this a more efficient way such as putting the form fields and values into a loop but not sure how do to it correctly. Please advise how I can make the loop below work?
Code:
<cfset myvar = "">
<cfloop list="#form.fieldnames#" index="i">
<cfif len(trim(i)) gt 0>
<!--- put #i# here or what? --->
</cfif>
</cfloop>
<form action="goto.cfm" method="post">
<!--- not sure if this is in the right direction? --->
<input type="hidden" name="myvar" value="#i#">
</form>
</cfoutput>