title: cfloop through dynamic form fields
body: <p>I have a form that allows the user to add co-authors so I'm trying to loop through those fields (if they exist) but can't seem to be able to get the values. "coauthorNo" is a hidden input field that only exists if the user adds 1 or more co-authors. I'm testing with a cfoutput in my page to see if I can get the values but no luck thus far. This is running on a Coldfusion 10 server. </p>
  
  <pre><code>&lt;cfif IsDefined("FORM.coauthorNo")&gt;    
    &lt;cfset coAuthCount = listLen("#FORM.coauthorNo#", ",")&gt;
  
              &lt;cfloop from="0" to="#coAuthCount#" index="i"&gt;
                  &lt;cfset CoAuthF = "#FORM['CoAuthFirstName'&amp;i]#"&gt;
                  &lt;cfset CoAuthL = "#FORM['CoAuthLastName'&amp;i]#"&gt;
  
                  &lt;cfoutput&gt;CoAuth's: #CoAuthF#, #CoAuthL#,&lt;/cfoutput&gt;
              &lt;/cfloop&gt;
  &lt;/cfif&gt;
  </code></pre>
  
  <p>Edit: Changed the cfloop from value to 1 and that fixed it. My dynamically created form fields started at 1 vs 0. ie CoAuthFirstName1</p>