Results 1 to 3 of 3
  1. #1

    Using Form Arrays in CFMX


    I'm currently trying to retrive an array from a form in CFMX, but am having a few problems. My form has 11 fields, all named 'newentry[]'. So once the array in the form is created, the action does the following:

    	<cfset reginfo = "#form.newentry#(1)">
    	<cfset error = arrayNew(1)>
    	<!--- Search for Blank Fields --->
    	<cfloop index="x" from="1" to="11">
    	<cfif len(trim(reginfo[x]))>
    	 <cfset reginfo[x] = "#HTMLEditFormat(reginfo[x])#">
    	 <cfset error[x] = "no">
               <cfset error[x] = "yes">
    	<cfloop index="x" from="1" to="11">
    Now, this SHOULD set the array from the form equal to a new array called "reginfo", and then it should check to see if each one is blank, before formatting it and printing out the final results. But its telling me that form.newentry is a part of some java class, and it wont let me do anything.

    Is there a special method of formatting arrays from a form that I am unaware of? Thanks!

  2. #2
    Join Date
    May 2002
    Have you tried a <cfdump> to see what is and isn't set. Usually that sort of thing helps you debug all sorts of things from arrays to XML structures.

  3. #3
    yeah, it returns nothing. it tells me the array doesnt exist in the form.

    but doesnt naming the fields as name="whatever[]" automaticaly create an array?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts