I have a page which tries to get the value from another server using cfhttp. Then using cfhttpparam to iterate through all form fields and then construct a struct. This struct will then be appended to an array using arrayAppend.
My query is, I want to see if all the form fields and values have been inserted into the struct. I tried to put cfoutput, but its not working inside cfhttp.
Could any one please help me out in this?
Many thanks in advance
This is the code snippet
<cfhttp url="#URL#" throwonerror="yes" method="post" timeout="300">
<cfloop list="#listSort(structKeyList(form),'textnocase')#" index="i">
<cfif i is not "fieldnames">
<cfset arrayOfValues = listToArray(evaluate('form.#i#'),',') />
<cfif arrayLen(arrayOfValues) LT 2>
<cfhttpparam type="formfield" name="#i#" value="#evaluate('form.#i#')#" />
<cfset tempStruct = structNew() />
<cfset tempStruct.name = i />
<cfset tempStruct.value = evaluate('form.#i#') />
<cfset tempStruct.from = 'form' />
<cfset arrayAppend(array1,tempStruct) />
<cfelse>
<cfloop from="1"to="#arrayLen(arrayOfValues)#" index="j">
<cfhttpparam type="formfield" name="#i#" value="#arrayOfValues[j]#" />
<cfset tempStruct = structNew() />
<cfset tempStruct.name = i />
<cfset tempStruct.value = arrayOfValues[j] />
<cfset tempStruct.from = 'form' />
<cfset arrayAppend(array1,tempStruct) />
</cfloop>
</cfif>
</cfif>
</cfloop>
</cfhttp>
After your
<cfhttp>