Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8357639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:32:36+00:00 2026-06-09T10:32:36+00:00

I am looping over a collection (form) and testing for ‘attachedFile’ in the form

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T10:32:38+00:00Added an answer on June 9, 2026 at 10:32 am
    <cfloop collection="#Form#" item="field">
        <cfset currentFieldName  = field>
        <cfset currentFieldValue = Form[field]>
    </cfloop>
    

    http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7fe2.html

    Or if you prefer the script style, and you’re using CF9, use the for-in loop

    <cfscript>
        for (field in Form)
        {
            currentFieldName  = field;
            currentFieldValue = Form[field];
        }
    </cfscript>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm familiar with the problem of modifying a collection while looping over it with
I need to iterate over a backbone collection and get an array of objects
I'm looping over a collection of Movies in my movie like so: <li> <%=
I'm looking for a fast, embeddable key/value store with cursor semantics over key collections
I'm trying to read a file of regexes, looping over them and filtering them
I have HTML table. I'm looping through table and iterate over each row whose
I am trying to iterate over a collection of items, perform an action and
I have three collection.deques and what I need to do is to iterate over
When looping over a group of items using jquery selectors is there a way
I'm using jquery datepicker(). In my index, I'm looping over: @tasks using a partial

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.