Search forums only
Search forums only
Adobe Creative Cloud
Downloading, Installing, Setting Up
Adobe Experience Cloud
Adobe Flash Player
Adobe Photoshop Lightroom
Adobe Photoshop Elements
Adobe Animate CC
Adobe Premiere Pro
Adobe After Effects
View all communities
Meet the experts
Learn our products
Get inspired in the lounge
Read the blog
Please enter a title.
You can not post a blank message. Please type your message and try again.
on Sep 22, 2006 12:30 AM by interarnett2
Form field with comma delimited value list to cfc
Sep 21, 2006 11:24 PM
I have a form that passes a field to an action page with a comma delimited value.
For instance the field name is: Program_ID
value for program_ID is: 31, 32
I am able to treat this variable as a list and check its length, and loop over the list prior to passing it to a cfc using the attached code:
When I try and pass the variable as a string to a cfc and invoke a query, cf no longer recognizes my var as a list.
Therefore the code attached does not function...
Is there a specific var type that will pass through as a list and allow me to run the code block attached?
This content has been marked as final.
Show 1 reply
Re: Form field with comma delimited value list to cfc
Sep 22, 2006 12:30 AM
in response to interarnett2
Ok answered my own question.. Here is the answer for those who are interested...
initialize var for cfc in cfinvoke statement
<cfinvokeargument name="Program_ID" value="#Form.Program_ID#">
pass argument to cfc as a string
<cfargument name="Program_ID" type="string" required="true">
use listqualify to parse list in cfc and set new var
<cfset selectedProgramID = ListQualify(Program_ID,"'",",","CHAR")>
use the new var in the following statement in sql code:
((Program_ID) IN (#PreserveSingleQuotes(selectedProgramID)#))
The following code handles a form field with a single value or a comma delimited value.
More Like This
Retrieving data ...
- 10 points