I am looping over a collection (form) and testing for 'attachedFile' in the form field name. On success, I want to add the form field value to an array. Currently, I am only getting the form field name and not the value.
<cfloop collection="#FORM#" item="field">
<cfif FindNoCase('attachedFile',field) IS 1>
<cfset fileNamesArray[fileNamesIndex] = field>
<cfset fileNamesIndex = fileNamesIndex + 1>
</cfif>
</cfloop>
I tried setting the array at index [whatever] to #form.field# but that results in an error (undefined). Any ideas how to get my value inside this loop? Thanks.
ArrayAppend()that you can use if you're just inserting things into an array. - HenryarrayAppendis much simpler iearrayAppend(fieldNamesAray, FORM[field]);- Leigh