chaduka
asked on
Capturing All Variables
I need to capture all the variables from a POST submitted form. Take in mind that the fields in this form are unknown, that means the CFM template is a generic one. It's easy with GET submitted form because one can use CGI.QUERY_STRING and list manipulation functions. I can't seem to find an environment variable like CGI.QUERY_STRING to handle POST submitted forms. Help?
can you post a part of your code?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Aaaaah, exactly what I am looking for.
Thanx a lot.
Thanx a lot.
the line...
<cfset Value#form_element# = #Evaluate(FORM.fieldnames) #>
should be
<cfset Value#form_element# = #Evaluate(form_element)#>
<cfset Value#form_element# = #Evaluate(FORM.fieldnames)
should be
<cfset Value#form_element# = #Evaluate(form_element)#>
ASKER
Thanx,
I preferred to do something like this:
<cfset fieldNamesArray = ArrayNew(1)>
<cfset fieldValuesArray = ArrayNew(1)>
<cfset arrayIndex = 1>
<cfset formFieldNamesArray = ListToArray(form.fieldname s, ",")>
<cfloop index="fieldName" list="#form.fieldNames#">
<cfset fieldNamesArray[arrayIndex ] = #fieldName#>
<cfset fieldValuesArray[arrayInde x] = #evaluate(fieldName)#>
<cfset arrayIndex = IncrementValue(arrayIndex) >
</cfloop>
I preferred to do something like this:
<cfset fieldNamesArray = ArrayNew(1)>
<cfset fieldValuesArray = ArrayNew(1)>
<cfset arrayIndex = 1>
<cfset formFieldNamesArray = ListToArray(form.fieldname
<cfloop index="fieldName" list="#form.fieldNames#">
<cfset fieldNamesArray[arrayIndex
<cfset fieldValuesArray[arrayInde
<cfset arrayIndex = IncrementValue(arrayIndex)
</cfloop>