I have form.mydata coming to my action page with comma delimeter value:
adam,joe,ben,steve,jill,andy,david

I want to seperate them and it works inside this loop:

<cfset myd = "">
<cfloop list="form.mydata" index="i" delimiters=",">
  <cfoutput>
   <cfset myd = "#i#">
   #myd#<br />
 </cfoutput>
</cfloop>

How do I get them to print outside of loop?
This didnt work because it only printed the first value only and not all of them:

<cfset myd = "">
<cfloop list="form.mydata" index="i" delimiters=",">
  <cfoutput>
   <cfset myd = "#i#">
 </cfoutput>
</cfloop>
 <cfoutput>
   #myd#<br />
 </cfoutput>

When you use a variable in the list element of the CFLOOP tag, it must be enclosed in #'s...

<cfset myd = "">
<cfloop list="#form.mydata#" index="i" delimiters=",">
  <cfoutput>
   <cfset myd = "#i#">
   #myd#<br />
 </cfoutput>
</cfloop>

Otherwise, it interprets it as a literal value.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.