i have a bunch of questions and answers, the un answered questiones must be thrown at the top with error message, the answers are in array and if un answered the array stores the value as undefined array element.
I tried to retrieve the position of the element by converting it to list, but while looping the list is missing out the empty element. when I loop it with simple loop:
<cfloop from ="1" to="#arraylen(currentinfo.answers)#" index="ele">
<cfset i = i+1>
<cfif not listlen(currentinfo.answers[ele],'-')><cfset j=#i#>#j#</cfif>
</cfloop>
I'm getting error below:
Element 5 is undefined in a Java object of type class coldfusion.runtime.Array.
The error occurred in D:\sites\askseaton\sections\PSSurvey\Clients\tags\surveydisplay.cfm: line 194
192 : <cfloop from ="1" to="#arraylen(currentinfo.answers)#" index="ele">
193 : <cfset i = i+1>
194 : <cfif not listlen(currentinfo.answers[ele],'-')><cfset j=#i#>#j#</cfif>
195 : </cfloop>
196 : <div>Question(s)#j# must be answered to proceed further.</div>